Skip to content

fix __import__ using level -1 which is not accepted in Python 3 #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

bohdon
Copy link

@bohdon bohdon commented Aug 13, 2021

Looks like there were some wrapper function __import__ calls still using the no-longer-supported level -1. This fix updates the level to 0.

For reference, the command I was using that caused an error originally was pm.getPanel(underPointer=True) in Maya 2022.1

@JPTUNA
Copy link

JPTUNA commented Aug 28, 2023

We have an issue with one of our plug-ins where a ValueError: level must be >=0 is raised, using pymel 1.4.0.

In the standard initializePlugin call for a maya plug-in, we call:
pm.callbacks(addCallback=loadAETemplateCallback, hook='AETemplateCustomContent', owner=kPluginNodeName)

the callback:

def loadAETemplateCallback(nodeName):
    AEinstanceAlongCurveLocatorTemplate(nodeName)

the class:
class AEinstanceAlongCurveLocatorTemplate(pm.ui.AETemplate): ...

It looks like it is coming from the inherited AETemplate, which when instantiated leads to AELoader calling load, which is fixed by the core/uiTypes.py change in this PR.

Another fix was merged for the internal/factories.py #447 , but the uiTypes.py fix in here has been ignored.

@efleurant
Copy link

We have an issue with one of our plug-ins where a ValueError: level must be >=0 is raised, using pymel 1.4.0.

In the standard initializePlugin call for a maya plug-in, we call: pm.callbacks(addCallback=loadAETemplateCallback, hook='AETemplateCustomContent', owner=kPluginNodeName)

the callback:

def loadAETemplateCallback(nodeName):
    AEinstanceAlongCurveLocatorTemplate(nodeName)

the class: class AEinstanceAlongCurveLocatorTemplate(pm.ui.AETemplate): ...

It looks like it is coming from the inherited AETemplate, which when instantiated leads to AELoader calling load, which is fixed by the core/uiTypes.py change in this PR.

Another fix was merged for the internal/factories.py #447 , but the uiTypes.py fix in here has been ignored.

I'd like to second that. Is it possible to push the missing change in uiTypes.py from #447 ? Or do we need to create another pull request?

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants