Skip to content

Commit bf6fd08

Browse files
authored
Use basename to get package name (#583)
Fixes #582
1 parent 2ee2cf3 commit bf6fd08

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/eachdist.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from datetime import datetime
1212
from inspect import cleandoc
1313
from itertools import chain
14+
from os.path import basename
1415
from pathlib import Path, PurePath
1516

1617
DEFAULT_ALLSEP = " "
@@ -631,9 +632,7 @@ def update_dependencies(targets, version, packages):
631632
if str(pkg) == "all":
632633
continue
633634
print(pkg)
634-
package_name = str(pkg).split("/", maxsplit=1)[-1]
635-
# Windows uses backslashes
636-
package_name = str(pkg).split("\\", maxsplit=1)[-1]
635+
package_name = basename(pkg)
637636
print(package_name)
638637

639638
update_files(

0 commit comments

Comments
 (0)