If you try to do the following:
Load a script
Script imports a lib
lib also imports a nonworking file
You'll just get an ImportError for the first lib, not the others
just a heads up..
Import errors are obsured...
Import errors are obsured...
Libraries: k2tools
Plugins (any): GSRPG (soon) | Pretty Status List | MySQLAds (soon)
Plugins (game-specific): None atm
If you happen to find a bug or need help, either post in the release threads or contact me in IRC gamesurge.net:6667 / #sourcepython
Plugins (any): GSRPG (soon) | Pretty Status List | MySQLAds (soon)
Plugins (game-specific): None atm
If you happen to find a bug or need help, either post in the release threads or contact me in IRC gamesurge.net:6667 / #sourcepython
It seems to happen only with non-standard imports in packages (though I got it earlier with standard imports in a package, but I can't seem to replicate it again :S):
test2/test2.py
_libs/mypackage/derp.py
Error that shows up:
test2/test2.py
Syntax: Select all
from mypackage import derp
_libs/mypackage/derp.py
Syntax: Select all
__import__("This is gonna fail")
Error that shows up:
Syntax: Select all
ImportError: cannot import name derp
Libraries: k2tools
Plugins (any): GSRPG (soon) | Pretty Status List | MySQLAds (soon)
Plugins (game-specific): None atm
If you happen to find a bug or need help, either post in the release threads or contact me in IRC gamesurge.net:6667 / #sourcepython
Plugins (any): GSRPG (soon) | Pretty Status List | MySQLAds (soon)
Plugins (game-specific): None atm
If you happen to find a bug or need help, either post in the release threads or contact me in IRC gamesurge.net:6667 / #sourcepython
I'm not sure what to tell you. I assumed that "maybe" the issue was that we remove all lines that have "importlib" in them to reduce the spam within the exception printed. However, I placed some debugging messages prior to that happening, and I still get the exact same result. Maybe, instead of simply using __import__, you should use a try/except and print out (or simply raise) the exception yourself when the import fails. I am a little confused why this is happening, though. I will continue to investigate.
Satoon
Satoon
Return to “General Discussion”
Who is online
Users browsing this forum: No registered users and 68 guests