diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/code_generators/generate_umath.py | 6 | ||||
-rw-r--r-- | numpy/core/setup.py | 16 |
2 files changed, 13 insertions, 9 deletions
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py index c2f1450f7..19940a385 100644 --- a/numpy/core/code_generators/generate_umath.py +++ b/numpy/core/code_generators/generate_umath.py @@ -110,7 +110,11 @@ class Ufunc(object): # String-handling utilities to avoid locale-dependence. import string -UPPER_TABLE = string.maketrans(string.ascii_lowercase, string.ascii_uppercase) +if sys.version_info[0] < 3: + UPPER_TABLE = string.maketrans(string.ascii_lowercase, string.ascii_uppercase) +else: + UPPER_TABLE = string.maketrans(bytes(string.ascii_lowercase, "ascii"), + bytes(string.ascii_uppercase, "ascii")) def english_upper(s): """ Apply English case rules to convert ASCII strings to all upper case. diff --git a/numpy/core/setup.py b/numpy/core/setup.py index 4b89319f1..072ac3c11 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -104,8 +104,8 @@ def win32_checks(deflist): a = get_build_architecture() # Distutils hack on AMD64 on windows - print 'BUILD_ARCHITECTURE: %r, os.name=%r, sys.platform=%r' % \ - (a, os.name, sys.platform) + print('BUILD_ARCHITECTURE: %r, os.name=%r, sys.platform=%r' % \ + (a, os.name, sys.platform)) if a == 'AMD64': deflist.append('DISTUTILS_USE_SDK') @@ -444,11 +444,11 @@ def configuration(parent_package='',top_path=None): """) target_f.close() - print 'File:',target + print('File:',target) target_f = open(target) - print target_f.read() + print(target_f.read()) target_f.close() - print 'EOF' + print('EOF') else: mathlibs = [] target_f = open(target) @@ -529,11 +529,11 @@ def configuration(parent_package='',top_path=None): target_f.close() # Dump the numpyconfig.h header to stdout - print 'File: %s' % target + print('File: %s' % target) target_f = open(target) - print target_f.read() + print(target_f.read()) target_f.close() - print 'EOF' + print('EOF') config.add_data_files((header_dir, target)) return target |