pep8: Fix E711, comparisons to None should use 'is' or 'is not'
Lengthy discussion of why this is a good thing (I didn't know) at SO: http://stackoverflow.com/questions/2209755/python-operation-vs-is-not
This commit is contained in:
+1
-1
@@ -117,7 +117,7 @@ class MininetLogger( Logger, object ):
|
|||||||
Convenience function to support lowercase names.
|
Convenience function to support lowercase names.
|
||||||
levelName: level name from LEVELS"""
|
levelName: level name from LEVELS"""
|
||||||
level = LOGLEVELDEFAULT
|
level = LOGLEVELDEFAULT
|
||||||
if levelname != None:
|
if levelname is not None:
|
||||||
if levelname not in LEVELS:
|
if levelname not in LEVELS:
|
||||||
raise Exception( 'unknown levelname seen in setLogLevel' )
|
raise Exception( 'unknown levelname seen in setLogLevel' )
|
||||||
else:
|
else:
|
||||||
|
|||||||
+1
-1
@@ -421,7 +421,7 @@ class Mininet( object ):
|
|||||||
return (1, 0)
|
return (1, 0)
|
||||||
r = r'(\d+) packets transmitted, (\d+) received'
|
r = r'(\d+) packets transmitted, (\d+) received'
|
||||||
m = re.search( r, pingOutput )
|
m = re.search( r, pingOutput )
|
||||||
if m == None:
|
if m is None:
|
||||||
error( '*** Error: could not parse ping output: %s\n' %
|
error( '*** Error: could not parse ping output: %s\n' %
|
||||||
pingOutput )
|
pingOutput )
|
||||||
return (1, 0)
|
return (1, 0)
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ def oldQuietRun( *cmd ):
|
|||||||
break
|
break
|
||||||
out += data
|
out += data
|
||||||
popen.poll()
|
popen.poll()
|
||||||
if popen.returncode != None:
|
if popen.returncode is not None:
|
||||||
break
|
break
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user