diff options
author | André Glüpker <git@wgmd.de> | 2016-04-15 15:36:05 +0200 |
---|---|---|
committer | André Glüpker <git@wgmd.de> | 2016-04-15 15:36:05 +0200 |
commit | d90be97c3744c90263eeebfba0ed8572125fd89e (patch) | |
tree | 71664f3db4faaaaf66c333f020695918604530bc | |
parent | 280d5a4222de687374486bf122e51c3bf9318f81 (diff) | |
download | 9kwpyqt-d90be97c3744c90263eeebfba0ed8572125fd89e.tar.gz 9kwpyqt-d90be97c3744c90263eeebfba0ed8572125fd89e.tar.bz2 9kwpyqt-d90be97c3744c90263eeebfba0ed8572125fd89e.zip |
Close file descriptor after reading config
Thanks to https://github.com/hut/ranger/issues/529
-rwxr-xr-x | 9kwpyqt.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -337,7 +337,8 @@ class CaptchaGUI(QWidget): defaultconfig['Autostart'] = 'no' self.config = configparser.ConfigParser(defaultconfig) try: - self.config.read_file(open('9kwpyqt.ini')) + with open('9kwpyqt.ini') as configfile: + self.config.read_file(configfile) except FileNotFoundError: self.writeConfig() return False |