Skip to content

Commit

Permalink
Replace first argument to exec() with a string.
Browse files Browse the repository at this point in the history
exec() in Python 3 no longer accepts an open file descriptor.
  • Loading branch information
rodrigc committed Jan 19, 2017
1 parent a8a9c3f commit 0fe636a
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 0fe636a

Please sign in to comment.