commit f5cfc688fe7d809c7d76bd6935b5a630fde6401f Author: Damian Johnson atagar@torproject.org Date: Sat Jan 11 13:33:30 2020 -0800
Fix exec syntax
Updating the syntax for exec...
https://docs.python.org/2.0/ref/exec.html https://docs.python.org/3/library/functions.html#exec
This fixes the following errors...
Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/twisted/trial/runner.py", line 823, in loadByName return self.suiteFactory([self.findByName(name, recurse=recurse)]) File "/usr/local/lib/python3.5/dist-packages/twisted/trial/runner.py", line 702, in findByName __import__(name) File "/home/atagar/Desktop/tor/bridgedb/bridgedb/test/test_https.py", line 41, in <module> from bridgedb.test.test_Tests import DynamicTestCaseMeta File "/home/atagar/Desktop/tor/bridgedb/bridgedb/test/test_Tests.py", line 29, in <module> from bridgedb.test import legacy_Tests as Tests File "/home/atagar/Desktop/tor/bridgedb/bridgedb/test/legacy_Tests.py", line 21, in <module> import bridgedb.main File "/home/atagar/Desktop/tor/bridgedb/bridgedb/main.py", line 24, in <module> from bridgedb import persistent File "/home/atagar/Desktop/tor/bridgedb/bridgedb/persistent.py", line 30, in <module> from bridgedb.configure import Conf builtins.SyntaxError: Missing parentheses in call to 'exec' (configure.py, line 85)
This changes test results as follows...
before: FAILED (skips=6, failures=9, errors=194, successes=359) after: FAILED (skips=103, failures=9, errors=189, successes=366) --- bridgedb/configure.py | 2 +- bridgedb/test/email_helpers.py | 2 +- bridgedb/test/https_helpers.py | 2 +- bridgedb/test/moat_helpers.py | 2 +- bridgedb/test/test_persistent.py | 2 +- bridgedb/test/test_persistentSaveAndLoad.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/bridgedb/configure.py b/bridgedb/configure.py index 0bc4dd1..e069ea3 100644 --- a/bridgedb/configure.py +++ b/bridgedb/configure.py @@ -82,7 +82,7 @@ def loadConfig(configFile=None, configCls=None): if itsSafeToUseLogging: logging.info("Loading settings from config file: '%s'" % conffile) compiled = compile(open(conffile).read(), '<string>', 'exec') - exec compiled in configuration + exec(compiled, configuration)
if itsSafeToUseLogging: logging.debug("New configuration settings:") diff --git a/bridgedb/test/email_helpers.py b/bridgedb/test/email_helpers.py index e149dd5..2fe8cdc 100644 --- a/bridgedb/test/email_helpers.py +++ b/bridgedb/test/email_helpers.py @@ -103,7 +103,7 @@ def _createConfig(configFile=TEST_CONFIG_FILE): configuration = {} TEST_CONFIG_FILE.seek(0) compiled = compile(configFile.read(), '<string>', 'exec') - exec compiled in configuration + exec(compiled, configuration) config = Conf(**configuration) return config
diff --git a/bridgedb/test/https_helpers.py b/bridgedb/test/https_helpers.py index fad841e..8c77085 100644 --- a/bridgedb/test/https_helpers.py +++ b/bridgedb/test/https_helpers.py @@ -107,7 +107,7 @@ def _createConfig(configFile=TEST_CONFIG_FILE): configuration = {} TEST_CONFIG_FILE.seek(0) compiled = compile(configFile.read(), '<string>', 'exec') - exec compiled in configuration + exec(compiled, configuration) config = Conf(**configuration) return config
diff --git a/bridgedb/test/moat_helpers.py b/bridgedb/test/moat_helpers.py index 07b44a0..8c40c82 100644 --- a/bridgedb/test/moat_helpers.py +++ b/bridgedb/test/moat_helpers.py @@ -94,7 +94,7 @@ def _createConfig(configFile=TEST_CONFIG_FILE): configuration = {} TEST_CONFIG_FILE.seek(0) compiled = compile(configFile.read(), '<string>', 'exec') - exec compiled in configuration + exec(compiled, configuration) config = Conf(**configuration) return config
diff --git a/bridgedb/test/test_persistent.py b/bridgedb/test/test_persistent.py index 3ff6d87..72b4b85 100644 --- a/bridgedb/test/test_persistent.py +++ b/bridgedb/test/test_persistent.py @@ -47,7 +47,7 @@ class StateTest(unittest.TestCase): configuration = {} TEST_CONFIG_FILE.seek(0) compiled = compile(TEST_CONFIG_FILE.read(), '<string>', 'exec') - exec compiled in configuration + exec(compiled, configuration) config = persistent.Conf(**configuration)
fakeArgs = ['-c', os.path.join(os.getcwdu(), '..', 'bridgedb.conf')] diff --git a/bridgedb/test/test_persistentSaveAndLoad.py b/bridgedb/test/test_persistentSaveAndLoad.py index 0ebb1e2..07ea73b 100644 --- a/bridgedb/test/test_persistentSaveAndLoad.py +++ b/bridgedb/test/test_persistentSaveAndLoad.py @@ -42,7 +42,7 @@ class StateSaveAndLoadTests(unittest.TestCase): configuration = {} TEST_CONFIG_FILE.seek(0) compiled = compile(TEST_CONFIG_FILE.read(), '<string>', 'exec') - exec compiled in configuration + exec(compiled, configuration) config = persistent.Conf(**configuration)
self.config = config
tor-commits@lists.torproject.org