diff roundup/cgi/PageTemplates/PythonExpr.py @ 5389:f8673e720f30

Python 3 preparation: update function attribute names. Tool-assisted patch.
author Joseph Myers <jsm@polyomino.org.uk>
date Tue, 24 Jul 2018 22:23:00 +0000
parents d26921b851c3
children e70885fe72a4
line wrap: on
line diff
--- a/roundup/cgi/PageTemplates/PythonExpr.py	Tue Jul 24 22:22:08 2018 +0000
+++ b/roundup/cgi/PageTemplates/PythonExpr.py	Tue Jul 24 22:23:00 2018 +0000
@@ -40,7 +40,7 @@
 
     def _get_used_names(self):
         self._f_varnames = vnames = []
-        for vname in self._f.func_code.co_names:
+        for vname in self._f.__code__.co_names:
             if vname[0] not in '$_':
                 vnames.append(vname)
 
@@ -63,7 +63,7 @@
     def __call__(self, econtext):
         __traceback_info__ = 'python expression "%s"'%self.expr
         f = self._f
-        f.func_globals.update(self._bind_used_names(econtext))
+        f.__globals__.update(self._bind_used_names(econtext))
         return f()
 
     def __str__(self):

Roundup Issue Tracker: http://roundup-tracker.org/