Skip to content
Snippets Groups Projects
Commit 7a506047 authored by Brandon Heller's avatar Brandon Heller
Browse files

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
parent 0bd5c651
No related branches found
No related tags found
No related merge requests found
......@@ -117,7 +117,7 @@ def setLogLevel( self, levelname=None ):
Convenience function to support lowercase names.
levelName: level name from LEVELS"""
level = LOGLEVELDEFAULT
if levelname != None:
if levelname is not None:
if levelname not in LEVELS:
raise Exception( 'unknown levelname seen in setLogLevel' )
else:
......
......@@ -421,7 +421,7 @@ def _parsePing( pingOutput ):
return (1, 0)
r = r'(\d+) packets transmitted, (\d+) received'
m = re.search( r, pingOutput )
if m == None:
if m is None:
error( '*** Error: could not parse ping output: %s\n' %
pingOutput )
return (1, 0)
......
......@@ -46,7 +46,7 @@ def oldQuietRun( *cmd ):
break
out += data
popen.poll()
if popen.returncode != None:
if popen.returncode is not None:
break
return out
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment