Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f4940c

Browse files
committed
Replaced boolean test with 'is None'
1 parent 8989ea6 commit 0f4940c

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/ConfigParser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def get(self, section, option, raw=0, vars=None):
270270
d = self.__defaults.copy()
271271
d.update(sectdict)
272272
# Update with the entry specific variables
273-
if vars:
273+
if vars is not None:
274274
d.update(vars)
275275
option = self.optionxform(option)
276276
try:

Lib/dis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def dis(x=None):
1313
With no argument, disassemble the last traceback.
1414
1515
"""
16-
if not x:
16+
if x is None:
1717
distb()
1818
return
1919
if type(x) is types.InstanceType:
@@ -44,7 +44,7 @@ def dis(x=None):
4444

4545
def distb(tb=None):
4646
"""Disassemble a traceback (default: last traceback)."""
47-
if not tb:
47+
if tb is None:
4848
try:
4949
tb = sys.last_traceback
5050
except AttributeError:
@@ -312,12 +312,12 @@ def _test():
312312
fn = None
313313
else:
314314
fn = None
315-
if not fn:
315+
if fn is None:
316316
f = sys.stdin
317317
else:
318318
f = open(fn)
319319
source = f.read()
320-
if fn:
320+
if fn is not None:
321321
f.close()
322322
else:
323323
fn = "<stdin>"

0 commit comments

Comments
 (0)