diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-04-06 07:42:08 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-04-06 07:42:08 -0700 |
commit | 49a8902a673d6fb2ba9ca446fc652aa9d2e55e1b (patch) | |
tree | e71c0d8f6123307860a58796ed840bf32526b3fe /numpy/core/setup.py | |
parent | 3c8fc14665548c71a9cd144b2e16d9309a92e255 (diff) | |
parent | 4394515cd5632a7f110993ff75033d407d10861d (diff) | |
download | numpy-49a8902a673d6fb2ba9ca446fc652aa9d2e55e1b.tar.gz |
Merge pull request #3191 from charris/2to3-apply-imports-fixer
2to3: Apply `imports` fixer.
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r-- | numpy/core/setup.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py index c65012126..ea20b11d2 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -4,12 +4,14 @@ import imp import os import sys import shutil +import pickle +import copy +import warnings +import re from os.path import join from numpy.distutils import log from distutils.dep_util import newer from distutils.sysconfig import get_config_var -import warnings -import re from setup_common import * @@ -25,11 +27,9 @@ NPY_RELAXED_STRIDES_CHECKING = (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', " # configuration informations between extensions is not easy. # Using a pickled-based memoize does not work because config_cmd is an instance # method, which cPickle does not like. -try: - import cPickle as _pik -except ImportError: - import pickle as _pik -import copy +# +# Use pickle in all cases, as cPickle is gone in python3 and the difference +# in time is only in build. -- Charles Harris, 2013-03-30 class CallOnceOnly(object): def __init__(self): @@ -40,25 +40,25 @@ class CallOnceOnly(object): def check_types(self, *a, **kw): if self._check_types is None: out = check_types(*a, **kw) - self._check_types = _pik.dumps(out) + self._check_types = pickle.dumps(out) else: - out = copy.deepcopy(_pik.loads(self._check_types)) + out = copy.deepcopy(pickle.loads(self._check_types)) return out def check_ieee_macros(self, *a, **kw): if self._check_ieee_macros is None: out = check_ieee_macros(*a, **kw) - self._check_ieee_macros = _pik.dumps(out) + self._check_ieee_macros = pickle.dumps(out) else: - out = copy.deepcopy(_pik.loads(self._check_ieee_macros)) + out = copy.deepcopy(pickle.loads(self._check_ieee_macros)) return out def check_complex(self, *a, **kw): if self._check_complex is None: out = check_complex(*a, **kw) - self._check_complex = _pik.dumps(out) + self._check_complex = pickle.dumps(out) else: - out = copy.deepcopy(_pik.loads(self._check_complex)) + out = copy.deepcopy(pickle.loads(self._check_complex)) return out PYTHON_HAS_UNICODE_WIDE = True |