We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
pm.require
1 parent bf56f73 commit b7a935aCopy full SHA for b7a935a
python/pythonmonkey/require.py
@@ -253,4 +253,7 @@ def createRequire(filename: str):
253
def require(moduleIdentifier: str):
254
# Retrieve the caller’s filename from the call stack
255
filename = inspect.stack()[1].filename
256
+ # From the REPL, the filename is "<stdin>", which is not a valid path
257
+ if not os.path.exists(filename):
258
+ filename = os.path.join(os.getcwd(), "__main__") # use the CWD instead
259
return createRequire(filename)(moduleIdentifier)
0 commit comments