Skip to content

Commit b4d807a

Browse files
committed
Make sure that patched pip module has __file__ set
1 parent 27f3702 commit b4d807a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

graalpython/lib-graalpython/pip_hook.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ def find_spec(fullname, path, target=None):
7474
real_spec = finder.find_spec(fullname, path, target=None)
7575
if real_spec:
7676
sys.meta_path.remove(PipImportHook)
77-
return _frozen_importlib.ModuleSpec(fullname, PipLoader(real_spec), is_package=False)
77+
spec = _frozen_importlib.ModuleSpec(fullname, PipLoader(real_spec), is_package=False, origin=real_spec.origin)
78+
spec.has_location = real_spec.has_location
79+
return spec
7880

7981

8082
sys.meta_path.insert(0, PipImportHook)

0 commit comments

Comments
 (0)