summaryrefslogtreecommitdiff
path: root/numpy/ma/mrecords.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-13 09:05:31 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-04-13 09:05:31 -0600
commit68338eed3ae91c9846142e088c16b63635e58178 (patch)
treeadaec2f35174f838edbc932921eccac10c7c3886 /numpy/ma/mrecords.py
parent688bc60658b391524c6b641e0a5e5ecd73322d02 (diff)
downloadnumpy-68338eed3ae91c9846142e088c16b63635e58178.tar.gz
2to3: Apply basestring fixer.
The basestring class is not defined in Python 3 and the fixer replaces it with str. In order to have a common code base we define basestring in numpy/compat/py3k.py to be str when the Python version is >= 3, otherwise basestring and import it where needed. That works for most cases, but there are a few files where the version dependent define needs to be in the file. Closes #3042.
Diffstat (limited to 'numpy/ma/mrecords.py')
-rw-r--r--numpy/ma/mrecords.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py
index 72df5065e..e2c014a9c 100644
--- a/numpy/ma/mrecords.py
+++ b/numpy/ma/mrecords.py
@@ -20,13 +20,17 @@ from __future__ import division, absolute_import, print_function
__author__ = "Pierre GF Gerard-Marchant"
import sys
+import warnings
import numpy as np
-from numpy import bool_, dtype, \
- ndarray, recarray, array as narray
import numpy.core.numerictypes as ntypes
-from numpy.core.records import fromarrays as recfromarrays, \
- fromrecords as recfromrecords
+from numpy.compat import basestring
+from numpy import (
+ bool_, dtype, ndarray, recarray, array as narray
+ )
+from numpy.core.records import (
+ fromarrays as recfromarrays, fromrecords as recfromrecords
+ )
_byteorderconv = np.core.records._byteorderconv
_typestr = ntypes._typestr
@@ -37,7 +41,6 @@ from numpy.ma import MAError, MaskedArray, masked, nomask, masked_array, \
_check_fill_value = ma.core._check_fill_value
-import warnings
__all__ = ['MaskedRecords', 'mrecarray',
'fromarrays', 'fromrecords', 'fromtextfile', 'addfield',