summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2020-01-22 21:36:43 +1300
committerMike Taves <mwtoews@gmail.com>2020-01-22 21:36:43 +1300
commit81e770685baa85e72d69f5f8224e53d8193611fa (patch)
tree03329db36f227b17214b9c11ac1fd20d89c3fc89 /numpy/core
parente94cec800304a6a467cf90ce4e7d3e207770b4b4 (diff)
downloadnumpy-81e770685baa85e72d69f5f8224e53d8193611fa.tar.gz
MAINT: remove internal functions required to handle Python2/3 logic
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/setup_common.py35
1 files changed, 9 insertions, 26 deletions
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
index 6d8e603a7..08337a81e 100644
--- a/numpy/core/setup_common.py
+++ b/numpy/core/setup_common.py
@@ -311,32 +311,15 @@ def pyod(filename):
We only implement enough to get the necessary information for long double
representation, this is not intended as a compatible replacement for od.
"""
- def _pyod2():
- out = []
-
- with open(filename, 'rb') as fid:
- yo = [int(oct(int(binascii.b2a_hex(o), 16))) for o in fid.read()]
- for i in range(0, len(yo), 16):
- line = ['%07d' % int(oct(i))]
- line.extend(['%03d' % c for c in yo[i:i+16]])
- out.append(" ".join(line))
- return out
-
- def _pyod3():
- out = []
-
- with open(filename, 'rb') as fid:
- yo2 = [oct(o)[2:] for o in fid.read()]
- for i in range(0, len(yo2), 16):
- line = ['%07d' % int(oct(i)[2:])]
- line.extend(['%03d' % int(c) for c in yo2[i:i+16]])
- out.append(" ".join(line))
- return out
-
- if sys.version_info[0] < 3:
- return _pyod2()
- else:
- return _pyod3()
+ out = []
+ with open(filename, 'rb') as fid:
+ yo2 = [oct(o)[2:] for o in fid.read()]
+ for i in range(0, len(yo2), 16):
+ line = ['%07d' % int(oct(i)[2:])]
+ line.extend(['%03d' % int(c) for c in yo2[i:i+16]])
+ out.append(" ".join(line))
+ return out
+
_BEFORE_SEQ = ['000', '000', '000', '000', '000', '000', '000', '000',
'001', '043', '105', '147', '211', '253', '315', '357']