From a94fa00eb6475d548024c716defb73d3c5abfa29 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 3 May 2017 15:06:48 +0200 Subject: 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 --- fb.py | 5 +---- 1 file changed, 1 insertion(+), 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: -- cgit v1.2.3-24-g4f1b