summaryrefslogtreecommitdiff
path: root/numpy/compat/py3k.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-13 07:00:11 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-04-13 07:00:11 -0700
commit688bc60658b391524c6b641e0a5e5ecd73322d02 (patch)
tree1b210bb7361ce691e781884bf06f89c7ebd13360 /numpy/compat/py3k.py
parent74b08b3f0284d9d2dd55a15dd98a3846913b1b51 (diff)
parent7f5af37e26ba2e99ad3ee6928b78437f601e96e0 (diff)
downloadnumpy-688bc60658b391524c6b641e0a5e5ecd73322d02.tar.gz
Merge pull request #3232 from charris/2to3-apply-numliterals-fixer
2to3: Apply the `numliterals` fixer and skip the `long` fixer.
Diffstat (limited to 'numpy/compat/py3k.py')
-rw-r--r--numpy/compat/py3k.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/numpy/compat/py3k.py b/numpy/compat/py3k.py
index 4a7866a56..f45a9973f 100644
--- a/numpy/compat/py3k.py
+++ b/numpy/compat/py3k.py
@@ -6,12 +6,14 @@ from __future__ import division, absolute_import, print_function
__all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar',
'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested',
- 'asstr', 'open_latin1']
+ 'asstr', 'open_latin1', 'long']
import sys
if sys.version_info[0] >= 3:
import io
+ long = int
+ integer_types = (int,)
bytes = bytes
unicode = str
@@ -38,13 +40,17 @@ if sys.version_info[0] >= 3:
strchar = 'U'
+
else:
bytes = str
unicode = unicode
+ long = long
+ integer_types = (int, long)
asbytes = str
asstr = str
strchar = 'S'
+
def isfileobj(f):
return isinstance(f, file)
@@ -56,6 +62,7 @@ else:
def open_latin1(filename, mode='r'):
return open(filename, mode=mode)
+
def getexception():
return sys.exc_info()[1]