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/oldnumeric/compat.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/oldnumeric/compat.py')
-rw-r--r-- | numpy/oldnumeric/compat.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/numpy/oldnumeric/compat.py b/numpy/oldnumeric/compat.py index 46c3c727f..b63226571 100644 --- a/numpy/oldnumeric/compat.py +++ b/numpy/oldnumeric/compat.py @@ -3,6 +3,17 @@ """ from __future__ import division, absolute_import +import sys +import copy +import pickle +from pickle import dump, dumps + +import numpy.core.multiarray as multiarray +import numpy.core.umath as um +from numpy.core.numeric import array +from . import functions + + __all__ = ['NewAxis', 'UFuncType', 'UfuncType', 'ArrayType', 'arraytype', 'LittleEndian', 'arrayrange', 'matrixmultiply', @@ -13,13 +24,6 @@ __all__ = ['NewAxis', 'Unpickler', 'Pickler' ] -import numpy.core.multiarray as multiarray -import numpy.core.umath as um -from numpy.core.numeric import array -from . import functions -import sys - -from cPickle import dump, dumps mu = multiarray @@ -47,8 +51,7 @@ def DumpArray(m, fp): m.dump(fp) def LoadArray(fp): - import cPickle - return cPickle.load(fp) + return pickle.load(fp) def array_constructor(shape, typecode, thestr, Endian=LittleEndian): if typecode == "O": @@ -70,8 +73,7 @@ def pickle_array(a): (a.shape, a.dtype.char, a.tostring(), LittleEndian)) def loads(astr): - import cPickle - arr = cPickle.loads(astr.replace('Numeric', 'numpy.oldnumeric')) + arr = pickle.loads(astr.replace('Numeric', 'numpy.oldnumeric')) return arr def load(fp): @@ -97,7 +99,6 @@ def _LoadArray(fp): else: return m -import pickle, copy if sys.version_info[0] >= 3: class Unpickler(pickle.Unpickler): # XXX: should we implement this? It's not completely straightforward |