mirror of https://gitlab.com/bashrc2/epicyon
parent
e5da666d70
commit
94a26e6ff8
8
data.py
8
data.py
|
|
@ -16,9 +16,7 @@ def _store_base(text: str, filename: str, exception_text: str,
|
||||||
with open(filename, mode, encoding='utf-8') as fp:
|
with open(filename, mode, encoding='utf-8') as fp:
|
||||||
fp.write(text)
|
fp.write(text)
|
||||||
return True
|
return True
|
||||||
except OSError as exc:
|
except OSError:
|
||||||
if '[ex]' in exception_text:
|
|
||||||
exception_text = exception_text.replace('[ex]', str(exc))
|
|
||||||
print(exception_text)
|
print(exception_text)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
@ -30,9 +28,7 @@ def load_string(filename: str, exception_text: str) -> str:
|
||||||
with open(filename, 'r', encoding='utf-8') as fp:
|
with open(filename, 'r', encoding='utf-8') as fp:
|
||||||
text = fp.read()
|
text = fp.read()
|
||||||
return text
|
return text
|
||||||
except OSError as exc:
|
except OSError:
|
||||||
if '[ex]' in exception_text:
|
|
||||||
exception_text = exception_text.replace('[ex]', str(exc))
|
|
||||||
print(exception_text)
|
print(exception_text)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue