File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
graalpython/lib-graalpython Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,15 @@ def _PyModule_CreateInitialized_PyModule_New(name):
103
103
if _imp ._py_package_context .endswith (name ):
104
104
name = _imp ._py_package_context
105
105
_imp ._py_package_context = None
106
- return moduletype (name )
106
+ new_module = moduletype (name )
107
+ # TODO: (tfel) I don't think this is the right place to set it, but somehow
108
+ # at least in the import of sklearn.neighbors.dist_metrics through
109
+ # sklearn.neighbors.ball_tree the __package__ attribute seems to be already
110
+ # set in CPython. To not produce a warning, I'm setting it here, although I
111
+ # could not find what CPython really does
112
+ if "." in name :
113
+ new_module .__package__ = name .rpartition ('.' )[0 ]
114
+ return new_module
107
115
108
116
109
117
def PyModule_SetDocString (module , string ):
You can’t perform that action at this time.
0 commit comments