Skip to content

Commit

Permalink
Use is instead of equality for comparing with None
Browse files Browse the repository at this point in the history
  • Loading branch information
GeyseR committed Apr 11, 2019
1 parent db91810 commit 75b4d95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/yaml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def add_constructor(tag, constructor, Loader=None):
Constructor is a function that accepts a Loader instance
and a node object and produces the corresponding Python object.
"""
if Loader == None:
if Loader is None:
loader.Loader.add_constructor(tag, constructor)
loader.FullLoader.add_constructor(tag, constructor)
loader.UnsafeLoader.add_constructor(tag, constructor)
Expand All @@ -349,7 +349,7 @@ def add_multi_constructor(tag_prefix, multi_constructor, Loader=None):
Multi-constructor accepts a Loader instance, a tag suffix,
and a node object and produces the corresponding Python object.
"""
if Loader == None:
if Loader is None:
loader.Loader.add_multi_constructor(tag_prefix, multi_constructor)
loader.FullLoader.add_multi_constructor(tag_prefix, multi_constructor)
loader.UnsafeLoader.add_multi_constructor(tag_prefix, multi_constructor)
Expand Down
4 changes: 2 additions & 2 deletions lib3/yaml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def add_constructor(tag, constructor, Loader=None):
Constructor is a function that accepts a Loader instance
and a node object and produces the corresponding Python object.
"""
if Loader == None:
if Loader is None:
loader.Loader.add_constructor(tag, constructor)
loader.FullLoader.add_constructor(tag, constructor)
loader.UnsafeLoader.add_constructor(tag, constructor)
Expand All @@ -346,7 +346,7 @@ def add_multi_constructor(tag_prefix, multi_constructor, Loader=None):
Multi-constructor accepts a Loader instance, a tag suffix,
and a node object and produces the corresponding Python object.
"""
if Loader == None:
if Loader is None:
loader.Loader.add_multi_constructor(tag_prefix, multi_constructor)
loader.FullLoader.add_multi_constructor(tag_prefix, multi_constructor)
loader.UnsafeLoader.add_multi_constructor(tag_prefix, multi_constructor)
Expand Down

0 comments on commit 75b4d95

Please sign in to comment.