mirror of https://gitlab.com/bashrc2/epicyon
Add exception handling
parent
a28030d6e1
commit
78ac2e17ad
10
utils.py
10
utils.py
|
@ -1197,8 +1197,14 @@ def get_followers_list(base_dir: str,
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
with open(filename, 'r', encoding='utf-8') as fp_foll:
|
lines = []
|
||||||
lines = fp_foll.readlines()
|
try:
|
||||||
|
with open(filename, 'r', encoding='utf-8') as fp_foll:
|
||||||
|
lines = fp_foll.readlines()
|
||||||
|
except OSError:
|
||||||
|
print('EX: get_followers_list unable to read ' + filename)
|
||||||
|
|
||||||
|
if lines:
|
||||||
for i, _ in enumerate(lines):
|
for i, _ in enumerate(lines):
|
||||||
lines[i] = lines[i].strip()
|
lines[i] = lines[i].strip()
|
||||||
return lines
|
return lines
|
||||||
|
|
Loading…
Reference in New Issue