Skip to content

Commit b392550

Browse files
committed
Close the config file properly
1 parent 530353e commit b392550

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

jenkins_cli/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ def read_settings_from_file(cls, environment):
126126
# read the config file
127127
config = ConfigParser()
128128
try:
129-
config.readfp(open(filename, 'r'))
129+
with open(filename, 'r') as f:
130+
config.readfp(f)
130131
except Exception as e:
131132
raise CliException('Error reading %s: %s' % (filename, e))
132133

0 commit comments

Comments
 (0)