From 6f0e48eac4f20894c802c93ac75cfa4693fbaa36 Mon Sep 17 00:00:00 2001 From: rakiru Date: Thu, 11 Jan 2018 19:19:58 +0000 Subject: Replace None equality checks with identity checks Both work, but the identity check is the more correct/idiomatic approach (and also ever-so-slightly more efficient). --- asciifarm/common/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asciifarm/common/utils.py') diff --git a/asciifarm/common/utils.py b/asciifarm/common/utils.py index cdc8dd5..95ac32b 100644 --- a/asciifarm/common/utils.py +++ b/asciifarm/common/utils.py @@ -27,7 +27,7 @@ def concat(arr): def writeFileSafe(filename, data, tempname=None): - if tempname == None: + if tempname is None: tempname = filename + ".tempfile" with open(tempname, 'w') as f: f.write(data) -- cgit