summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-12-03 15:59:39 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-12-03 15:59:39 +0000
commitc121f74bd43bc24a4ce0bee38defeea99b51f05c (patch)
treebfce48f667a8a971f3cee808bc2455e1de41b077 /numpy
parent08ec7978368aa9d5bbaf52d8dde582e2af250eb1 (diff)
downloadnumpy-c121f74bd43bc24a4ce0bee38defeea99b51f05c.tar.gz
Py3k: make core setup.py py3k-importable.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/code_generators/generate_umath.py6
-rw-r--r--numpy/core/setup.py16
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