Using virtualenv and python 3.4, putting parentheses around the exec statement in ../app/config.py causes the same error message to surface and display of the previous unedited statement even though I am passing variables. TIA for any advice.
snippet of code
def load(self):
with open(self.path) as config_file:
name = 'configuration'
code = config_file.read()
module = imp.new_module(name)
exec(code, module.dict)
for name, value in module.__dict__.iteritems():
setattr(self, name, value)
Traceback (most recent call last):
File "/usr/local/bin/r3-app", line 9, in
load_entry_point('r3==0.2.0', 'console_scripts', 'r3-app')()
File "/usr/local/lib/python3.4/site-packages/r3/app/server.py", line 33, in main
cfg = Config(args.config_file)
File "/usr/local/lib/python3.4/site-packages/r3/app/config.py", line 14, in init
self.load()
File "/usr/local/lib/python3.4/site-packages/r3/app/config.py", line 21, in load
exec(code, module.dict)
File "", line 21
exec code in module.dict
^
SyntaxError: Missing parentheses in call to 'exec'
Using virtualenv and python 3.4, putting parentheses around the exec statement in ../app/config.py causes the same error message to surface and display of the previous unedited statement even though I am passing variables. TIA for any advice.
snippet of code
def load(self): with open(self.path) as config_file: name = 'configuration' code = config_file.read() module = imp.new_module(name) exec(code, module.dict)
Traceback (most recent call last): File "/usr/local/bin/r3-app", line 9, in
load_entry_point('r3==0.2.0', 'console_scripts', 'r3-app')()
File "/usr/local/lib/python3.4/site-packages/r3/app/server.py", line 33, in main
cfg = Config(args.config_file)
File "/usr/local/lib/python3.4/site-packages/r3/app/config.py", line 14, in init
self.load()
File "/usr/local/lib/python3.4/site-packages/r3/app/config.py", line 21, in load
exec(code, module.dict)
File "", line 21
exec code in module.dict
^
SyntaxError: Missing parentheses in call to 'exec'