summaryrefslogtreecommitdiff
path: root/magic.py
diff options
context:
space:
mode:
authorBruno ReniƩ <brutasse@gmail.com>2014-03-04 19:34:10 +0100
committerBruno ReniƩ <brutasse@gmail.com>2014-03-04 19:36:41 +0100
commit1c8424ec7c1f4f368cf8e19e33fcfdae3de925d4 (patch)
tree907cd5e64ea86e34880080165424e88c7f64a1f3 /magic.py
parent8c923032c76f7e17fd45b5f90f14ffb899ae5dcd (diff)
downloadpython-magic-1c8424ec7c1f4f368cf8e19e33fcfdae3de925d4.tar.gz
Workaround sys.version_info not being a named tuple on py26
Diffstat (limited to 'magic.py')
-rw-r--r--magic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/magic.py b/magic.py
index bd62175..f2f9d7d 100644
--- a/magic.py
+++ b/magic.py
@@ -195,9 +195,9 @@ def coerce_filename(filename):
# ctypes will implicitly convert unicode strings to bytes with
# .encode('ascii'). A more useful default here is
# getfilesystemencoding(). We need to leave byte-str unchanged.
- is_unicode = (sys.version_info.major <= 2 and
+ is_unicode = (sys.version_info[0] <= 2 and
isinstance(filename, unicode)) or \
- (sys.version_info.major >= 3 and
+ (sys.version_info[0] >= 3 and
isinstance(filename, str))
if is_unicode:
return filename.encode(sys.getfilesystemencoding())