Skip to content

Commit

Permalink
Fix issue with absolute path with Python 3.13 on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
adang1345 committed Oct 8, 2024
1 parent 378984e commit 401e6a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,8 @@ def _make_relative(base):
# Chop off the drive
no_drive = os.path.splitdrive(base)[1]
# If abs, chop off leading /
return no_drive[os.path.isabs(no_drive) :]
is_abs = os.path.isabs(no_drive) or sys.platform == 'win32' and (no_drive.startswith('/') or no_drive.startswith('\\'))
return no_drive[is_abs:]

def shared_object_filename(self, basename, strip_dir=False, output_dir=''):
assert output_dir is not None
Expand Down

0 comments on commit 401e6a6

Please sign in to comment.