From 9f8eae34d1d89d7cf01eef8a1a89dc431ef5f4e2 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 19 Jul 2018 13:35:27 +0200 Subject: [FIX] undefined variables (potential nameerror) Backport 9ec0455abc041b855dcab18e8e185baf806b9f14 and 6a601fe6dc848cdeca2ab8429210e3b5087275d9 as they fixed various possible NameError but did so in later sub-releases. --- odoo/modules/migration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'odoo/modules/migration.py') diff --git a/odoo/modules/migration.py b/odoo/modules/migration.py index e512d331caa..28a9c1c170d 100644 --- a/odoo/modules/migration.py +++ b/odoo/modules/migration.py @@ -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() -- cgit v1.2.3