Skip to content

Commit 1641115

Browse files
committed
removed duplicate code because of multipul PRs
2 parents 0e6a6fe + 6272de8 commit 1641115

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

CloudFlare/read_configs.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,30 @@ def read_configs():
2424
if email is None:
2525
try:
2626
email = re.sub(r"\s+", '', config.get('CloudFlare', 'email'))
27-
except ConfigParser.NoOptionError:
27+
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
2828
email = None
2929
except ConfigParser.NoSectionError:
3030
email = None
3131

3232
if token is None:
3333
try:
3434
token = re.sub(r"\s+", '', config.get('CloudFlare', 'token'))
35-
except ConfigParser.NoOptionError:
35+
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
3636
token = None
3737
except ConfigParser.NoSectionError:
3838
token = None
3939

4040
if certtoken is None:
4141
try:
4242
certtoken = re.sub(r"\s+", '', config.get('CloudFlare', 'certtoken'))
43-
except ConfigParser.NoOptionError:
43+
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
4444
certtoken = None
4545
except ConfigParser.NoSectionError:
4646
certtoken = None
4747

4848
try:
4949
extras = re.sub(r"\s+", ' ', config.get('CloudFlare', 'extras'))
50-
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
51-
extras = None
52-
except ConfigParser.NoSectionError:
50+
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
5351
extras = None
5452

5553
if extras:

0 commit comments

Comments
 (0)