Skip to content

Commit 63490ba

Browse files
committed
add a warning when host lookup is allowed, but the java.lang.Package class is not available
1 parent a3ef6e6 commit 63490ba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graalpython/lib-graalpython/java.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def is_java_package(name):
4747
package = type("java.lang.Package")
4848
return any(p.getName().startswith(name) for p in package.getPackages())
4949
except KeyError:
50+
if sys.flags.verbose:
51+
from _warnings import _warn
52+
_warn("Host lookup allowed, but java.lang.Package not available. Importing from Java cannot work.")
5053
return False
5154

5255
@staticmethod

0 commit comments

Comments
 (0)