Skip to content

Commit b2cbaac

Browse files
committed
bug: handle case where argv[0] is invoked by setuptools-py2cfg
I am working on migrating to pyproject.toml. I used setuptools-py2cfg to generate a toml version of setup.py. It results in argv[0] as a PosixPath and no a string. So guard against processing the PosixPath when looking for prefix argument. Overall the resulting pyproject.toml isn't installing any of the data files, docs etc. It doesn't seem to process MANIFEST.in to get the data files correctly. So no joy so far and I am not checking in the result.
1 parent 4dd59a3 commit b2cbaac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ def get_prefix():
7878
if prefix_arg:
7979
prefix = a
8080
break
81+
82+
# argv[0] can be a PosixPath when setup.py
83+
# is invoked by setuptools-py2cfg
84+
if not isinstance(a, str):
85+
continue
86+
8187
# is there a short form -p or something for this??
8288
if a.startswith('--prefix'):
8389
if a == '--prefix':

0 commit comments

Comments
 (0)