[PATCH 49 of 52 Narval cube] [flake8] fix undefined names

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 11:34:49 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585733331 0
#      Wed Apr 01 09:28:51 2020 +0000
# Node ID 15f4557e020178bcc2b17d14b8150cb4ee2f6246
# Parent  8f641c3c0433e0ed2289bd7d30fdb7b78c878abc
[flake8] fix undefined names

diff --git a/cubicweb_narval/narvalbot/engine.py b/cubicweb_narval/narvalbot/engine.py
--- a/cubicweb_narval/narvalbot/engine.py
+++ b/cubicweb_narval/narvalbot/engine.py
@@ -49,7 +49,7 @@
             if msg[-1:] != "\n":
                 msg += "\n"
             msg = record.exc_text
-        if isinstance(msg, unicode):
+        if isinstance(msg, str):
             msg = msg.encode('utf-8')
         return '%s\t%s\t%s\t%s<br/>' % (record.levelno,
                                         record.filename or '',
@@ -138,7 +138,7 @@
         with NamedTemporaryFile(suffix='.py') as f:
             f.write(self.script)
             f.flush()
-            execfile(f.name, {'plan': self})
+            exec(open(f.name).read(), {'plan': self})
 
 
 LOGGER = logging.getLogger('narval.engine')




More information about the cubicweb-devel mailing list