[FIX] undefined variables (potential nameerror)

Backport 9ec0455abc and
6a601fe6dc as they fixed various
possible NameError but did so in later sub-releases.
This commit is contained in:
Xavier Morel
2018-07-19 13:37:10 +02:00
parent bc12428e17
commit 9f8eae34d1
11 changed files with 19 additions and 14 deletions
+2 -1
View File
@@ -21,7 +21,8 @@ if pycompat.PY2:
fp, fname = tools.file_open(path, pathinfo=True)
fp2 = None
if not isinstance(fp, file): # pylint: disable=file-builtin
# pylint: disable=file-builtin,undefined-variable
if not isinstance(fp, file):
# imp.load_source need a real file object, so we create
# one from the file-like object we get from file_open
fp2 = os.tmpfile()