Skip to content

Commit cababac

Browse files
fangerertimfel
authored andcommitted
Fix patches dir in ginstall
1 parent a753a1d commit cababac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graalpython/lib-graalpython/modules/ginstall.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ def _install_from_url(url, package, extra_opts=None, add_cflags="", ignore_error
723723
info("auto-patching {}", extracted_dir)
724724
autopatch_capi.auto_patch_tree(extracted_dir)
725725

726-
patch_file_path = first_existing(package, versions, os.path.join(patches_dir, "sdist"), ".patch")
726+
patch_file_path = first_existing(package, versions, get_sdist_patch(patches_dir), ".patch")
727727
if patch_file_path:
728728
run_cmd(["patch", "-d", extracted_dir, "-p1", "-i", patch_file_path], quiet=quiet)
729729

@@ -800,6 +800,10 @@ def read_first_existing(pkg_name, versions, dir, suffix):
800800

801801
# end of code duplicated in pip_hook.py
802802

803+
def get_sdist_patch(patch_dir):
804+
sdist = os.path.join(patch_dir, "sdist")
805+
return sdist if os.path.isdir(sdist) else patch_dir
806+
803807

804808
def install_with_pip(package, msg="", failOnError=False, **kwargs):
805809
for kw in ['extra_opts', 'debug_build']:

0 commit comments

Comments
 (0)