Skip to content

Commit 8676f7b

Browse files
committed
Fixes #174
1 parent b0a54d5 commit 8676f7b

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

corems/__init__.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@
88
# Get the path to the README file
99
readme_path = os.path.join(os.path.dirname(__file__), "..", "README.md")
1010

11-
# Read the contents of the README file
12-
with open(readme_path, "r", encoding="utf-8") as readme_file:
13-
__doc__ = readme_file.read()
11+
# Read the contents of the README file if it exists
12+
if os.path.exists(readme_path):
13+
try:
14+
with open(readme_path, "r", encoding="utf-8") as readme_file:
15+
__doc__ = readme_file.read()
16+
except Exception as e:
17+
__doc__ = "CoreMS: A comprehensive mass spectrometry framework for software development and data analysis of small molecules analysis."
18+
print(f"Warning: Could not read README.md file. Error: {e}")
19+
else:
20+
__doc__ = "CoreMS: A comprehensive mass spectrometry framework for software development and data analysis of small molecules analysis."
21+
1422

1523

1624
def timeit(method):

0 commit comments

Comments
 (0)