Skip to content

Commit e51634d

Browse files
committed
Add suggestions from #246
1 parent a57fba0 commit e51634d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
author="Daniel Rojas",
1616
# author_email='',
1717
description="Easily document cables and wiring harnesses",
18-
long_description=open(README_PATH).read(),
18+
long_description=README_PATH.read_text(),
1919
long_description_content_type="text/markdown",
2020
install_requires=[
2121
"click",

src/wireviz/tools/build_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def clean_generated(groupkeys):
9797
for filename in collect_filenames("Cleaning", key, generated_extensions):
9898
if filename.is_file():
9999
print(f' rm "{filename}"')
100-
Path(filename).unlink()
100+
filename.unlink()
101101

102102

103103
def compare_generated(groupkeys, branch="", include_graphviz_output=False):

src/wireviz/wv_cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ def wireviz(file, format, prepend, output_dir, output_name, version):
111111
prepend_file = Path(prepend_file)
112112
if not prepend_file.exists():
113113
raise Exception(f"File does not exist:\n{prepend_file}")
114+
if not prepend_file.is_file():
115+
raise Exception(f"Path is not a file:\n{prepend_file}")
114116
print("Prepend file:", prepend_file)
115117

116118
prepend_input += open_file_read(prepend_file).read() + "\n"
@@ -122,6 +124,8 @@ def wireviz(file, format, prepend, output_dir, output_name, version):
122124
file = Path(file)
123125
if not file.exists():
124126
raise Exception(f"File does not exist:\n{file}")
127+
if not file.is_file():
128+
raise Exception(f"Path is not a file:\n{file}")
125129

126130
# file_out = file.with_suffix("") if not output_file else output_file
127131
_output_dir = file.parent if not output_dir else output_dir

0 commit comments

Comments
 (0)