Why does this missing import NOT raise an error?

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Why does this missing import NOT raise an error?

Postby Mahi » Tue Sep 27, 2016 2:38 pm

It seems like I've forgotten an import, but for one reason or another the code runs just fine and no errors are raised: https://github.com/Mahi/Warcraft-SP/blo ... ft.py#L186

I never import warcraft.listeners...
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Why does this missing import NOT raise an error?

Postby L'In20Cible » Tue Sep 27, 2016 3:42 pm

I assume that you import warcraft.heroes which import warcraft.entities which import warcraft.entities.hero which import warcraft.listeners bounding it to the warcraft module.
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Re: Why does this missing import NOT raise an error?

Postby Mahi » Tue Sep 27, 2016 3:59 pm

Ohhh, that's exactly it! I didn't know that it's enough for one file to import it like that if it's all in the same package. TIL, thanks :)

Edit: Just to be sure, I recommend nobody to start doing this just because it works.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 26 guests