summaryrefslogtreecommitdiff
path: root/numpy/numarray
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/numarray')
-rw-r--r--numpy/numarray/alter_code1.py2
-rw-r--r--numpy/numarray/functions.py2
-rw-r--r--numpy/numarray/session.py4
3 files changed, 4 insertions, 4 deletions
diff --git a/numpy/numarray/alter_code1.py b/numpy/numarray/alter_code1.py
index 4c5b7e9fc..a80a5ae3c 100644
--- a/numpy/numarray/alter_code1.py
+++ b/numpy/numarray/alter_code1.py
@@ -81,7 +81,7 @@ def changeimports(fstr, name, newname):
ind = 0
Nlen = len(fromstr)
Nlen2 = len("from %s import " % newname)
- while 1:
+ while True:
found = fstr.find(fromstr,ind)
if (found < 0):
break
diff --git a/numpy/numarray/functions.py b/numpy/numarray/functions.py
index 3f91046d2..78d05e5f5 100644
--- a/numpy/numarray/functions.py
+++ b/numpy/numarray/functions.py
@@ -222,7 +222,7 @@ def fromfile(infile, type=None, shape=None, sizing=STRICT,
buf = np.newbuffer(initsize)
bytesread=0
- while 1:
+ while True:
data=infile.read(blocksize)
if len(data) != blocksize: ##eof
break
diff --git a/numpy/numarray/session.py b/numpy/numarray/session.py
index f1dcbfbdc..e40cd4033 100644
--- a/numpy/numarray/session.py
+++ b/numpy/numarray/session.py
@@ -120,7 +120,7 @@ def _callers_modules():
g = _callers_globals()
mods = []
for k,v in g.items():
- if type(v) == type(sys):
+ if isinstance(v, type(sys)):
mods.append(getattr(v,"__name__"))
return mods
@@ -326,7 +326,7 @@ def load(variables=None, file=SAVEFILE, dictionary=None, verbose=False):
dictionary = _callers_globals()
values = []
p = pickle.Unpickler(file)
- while 1:
+ while True:
o = p.load()
if isinstance(o, _SaveSession):
session = dict(zip(o.keys, values))