summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-05-03 15:06:48 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-05-03 15:06:48 +0200
commita94fa00eb6475d548024c716defb73d3c5abfa29 (patch)
tree5a9a41e285807c2520dc30d37faeddc54409e27b
parente195665788a6eebec78007602c13198ec6ce3458 (diff)
Fix python2 compatability of config parser
FileNotFoundError does not exist in python2. Also it returns an IOError instead of OSError and IOError is an alias for OSError in python3 so just use IOError here so it works for both versions. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xfb.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/fb.py b/fb.py
index d0dc694..03a7b92 100755
--- a/fb.py
+++ b/fb.py
@@ -397,14 +397,11 @@ class ConfigParser:
def _parse(self, file, ignoreMissing=False):
try:
fh = open(file)
- except OSError as e:
+ except IOError as e:
if ignoreMissing:
if e.errno == errno.ENOENT:
return
raise
- except FileNotFoundError:
- if ignoreMissing:
- return
with fh:
for line in fh: