summaryrefslogtreecommitdiff
path: root/numpy/distutils
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/distutils')
-rw-r--r--numpy/distutils/ccompiler.py2
-rw-r--r--numpy/distutils/conv_template.py2
-rw-r--r--numpy/distutils/cpuinfo.py4
-rw-r--r--numpy/distutils/fcompiler/ibm.py3
-rw-r--r--numpy/distutils/from_template.py4
5 files changed, 7 insertions, 8 deletions
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py
index af59d687e..51a349aea 100644
--- a/numpy/distutils/ccompiler.py
+++ b/numpy/distutils/ccompiler.py
@@ -403,7 +403,7 @@ def simple_version_match(pat=r'[-.\d]+', ignore='', start=''):
if not m:
return None
pos = m.end()
- while 1:
+ while True:
m = re.search(pat, version_string[pos:])
if not m:
return None
diff --git a/numpy/distutils/conv_template.py b/numpy/distutils/conv_template.py
index 173853b6c..cb03fc7c3 100644
--- a/numpy/distutils/conv_template.py
+++ b/numpy/distutils/conv_template.py
@@ -120,7 +120,7 @@ def parse_structure(astr, level):
ind = 0
line = 0
spanlist = []
- while 1:
+ while True:
start = astr.find(loopbeg, ind)
if start == -1:
break
diff --git a/numpy/distutils/cpuinfo.py b/numpy/distutils/cpuinfo.py
index 775929fa1..64ad055d3 100644
--- a/numpy/distutils/cpuinfo.py
+++ b/numpy/distutils/cpuinfo.py
@@ -82,7 +82,7 @@ class CPUInfoBase(object):
if not name.startswith('_'):
if hasattr(self,'_'+name):
attr = getattr(self,'_'+name)
- if type(attr) is types.MethodType:
+ if isinstance(attr, types.MethodType):
return lambda func=self._try_call,attr=attr : func(attr)
else:
return lambda : None
@@ -499,7 +499,7 @@ class Win32CPUInfo(CPUInfoBase):
"\s+stepping\s+(?P<STP>\d+)",re.IGNORECASE)
chnd=winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, self.pkey)
pnum=0
- while 1:
+ while True:
try:
proc=winreg.EnumKey(chnd,pnum)
except winreg.error:
diff --git a/numpy/distutils/fcompiler/ibm.py b/numpy/distutils/fcompiler/ibm.py
index 5811be876..e5061bd18 100644
--- a/numpy/distutils/fcompiler/ibm.py
+++ b/numpy/distutils/fcompiler/ibm.py
@@ -45,8 +45,7 @@ class IBMFCompiler(FCompiler):
# If the output of xlf does not contain version info
# (that's the case with xlf 8.1, for instance) then
# let's try another method:
- l = os.listdir(xlf_dir)
- l.sort()
+ l = sorted(os.listdir(xlf_dir))
l.reverse()
l = [d for d in l if os.path.isfile(os.path.join(xlf_dir,d,'xlf.cfg'))]
if l:
diff --git a/numpy/distutils/from_template.py b/numpy/distutils/from_template.py
index 5d6bea3ca..9052cf74e 100644
--- a/numpy/distutils/from_template.py
+++ b/numpy/distutils/from_template.py
@@ -65,13 +65,13 @@ def parse_structure(astr):
spanlist = []
ind = 0
- while 1:
+ while True:
m = routine_start_re.search(astr,ind)
if m is None:
break
start = m.start()
if function_start_re.match(astr,start,m.end()):
- while 1:
+ while True:
i = astr.rfind('\n',ind,start)
if i==-1:
break