Merge "Close files after use"
This commit is contained in:
commit
629ef2d69d
|
@ -37,7 +37,8 @@ class DoxYaml(object):
|
|||
|
||||
def _open_dox_yaml(self):
|
||||
if self._yaml is None:
|
||||
self._yaml = yaml.load(open('dox.yml', 'r'))
|
||||
with open('dox.yml', 'r') as f:
|
||||
self._yaml = yaml.load(f)
|
||||
return self._yaml
|
||||
|
||||
def exists(self):
|
||||
|
|
|
@ -37,7 +37,8 @@ class TravisYaml(object):
|
|||
|
||||
def _open_travis_yaml(self):
|
||||
if self._yaml is None:
|
||||
self._yaml = yaml.load(open('travis.yml', 'r'))
|
||||
with open('travis.yml', 'r') as f:
|
||||
self._yaml = yaml.load(f)
|
||||
return self._yaml
|
||||
|
||||
def exists(self):
|
||||
|
|
|
@ -136,7 +136,8 @@ class Runner(object):
|
|||
for command in commands.prep_commands():
|
||||
dockerfile.append("RUN %s\n" % command)
|
||||
dockerfile = '\n'.join(dockerfile)
|
||||
open(os.path.join(tempd, 'Dockerfile'), 'w').write(dockerfile)
|
||||
with open(os.path.join(tempd, 'Dockerfile'), 'w') as f:
|
||||
f.write(dockerfile)
|
||||
logger.debug("Dockerfile:\n" + self._indent(dockerfile))
|
||||
self._docker_build(self.test_image_name, tempd)
|
||||
finally:
|
||||
|
|
Loading…
Reference in New Issue