Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #2613 from rodrigc/exec
Browse files Browse the repository at this point in the history
Replace first argument to exec() with a string.
  • Loading branch information
tardyp committed Jan 20, 2017
2 parents 55b30f0 + 0fe636a commit 1c50765
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions master/buildbot/config.py
Expand Up @@ -29,6 +29,7 @@

from twisted.python import failure
from twisted.python import log
from twisted.python.compat import execfile
from zope.interface import implementer

from buildbot import interfaces
Expand Down Expand Up @@ -103,7 +104,8 @@ def loadConfigDict(basedir, configFileName):
])

try:
f = open(filename, "r")
with open(filename, "r"):
pass
except IOError as e:
raise ConfigErrors([
"unable to open configuration file %r: %s" % (filename, e),
Expand All @@ -121,7 +123,7 @@ def loadConfigDict(basedir, configFileName):
sys.path.append(basedir)
try:
try:
exec(f, localDict)
execfile(filename, localDict)
except ConfigErrors:
raise
except SyntaxError:
Expand All @@ -136,7 +138,6 @@ def loadConfigDict(basedir, configFileName):
always_raise=True,
)
finally:
f.close()
sys.path[:] = old_sys_path

if 'BuildmasterConfig' not in localDict:
Expand Down

0 comments on commit 1c50765

Please sign in to comment.