diff test/test_cgi.py @ 5385:e9fb7c539a52

Python 3 preparation: use exec(compile(open().read())) instead of execfile(). Tool-assisted patch.
author Joseph Myers <jsm@polyomino.org.uk>
date Tue, 24 Jul 2018 22:18:30 +0000
parents 0942fe89e82e
children d26921b851c3
line wrap: on
line diff
--- a/test/test_cgi.py	Tue Jul 24 22:11:16 2018 +0000
+++ b/test/test_cgi.py	Tue Jul 24 22:18:30 2018 +0000
@@ -77,7 +77,10 @@
 
         vars = {}
         thisdir = os.path.dirname(__file__)
-        execfile(os.path.join(thisdir, "tx_Source_detector.py"), vars)
+        exec(compile(open(os.path.join(thisdir,
+                                       "tx_Source_detector.py")).read(),
+                     os.path.join(thisdir, "tx_Source_detector.py"), 'exec'),
+             vars)
         vars['init'](self.db)
 
         test = self.instance.backend.Class(self.db, "test",

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