Skip to content

Commit e48f9ac

Browse files
author
Jonathan, Lutterbeck
committed
Improved code
I merged the two isInstance calls to improve readability.
1 parent 774ba14 commit e48f9ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/configloader.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import shutil
22
import sys
33
import os.path
4-
import yaml
54
import pathlib
5+
import yaml
66

77

88
def default_config_path():
@@ -31,7 +31,7 @@ def default_config_path():
3131
if not os.path.exists(path):
3232
os.makedirs(path)
3333
else:
34-
raise RuntimeError("Operating sytem not supported")
34+
raise RuntimeError("Operating system not supported")
3535

3636
return path
3737

@@ -51,7 +51,7 @@ def load_config(path):
5151
Then it opens the specified config file and returns all keys which include token and UserId.
5252
"""
5353
# opens specified file to retrieve config tokens
54-
if isinstance(path, str) or isinstance(path, pathlib.Path):
54+
if isinstance(path, (pathlib.Path, str)):
5555
assert path
5656
with open(f"{path}", 'r') as stream:
5757
data = yaml.safe_load(stream)

0 commit comments

Comments
 (0)