samedi 13 janvier 2018

Python Interpreter Has Stopped Working Maya 2017

When I run a nose test using eclipse with the Maya 2017 mayapy.exe interpreter, it will run the test, but at the end it will crash the python interpreter. After a lot of researching i found that I need to put the following code after the test to stop that:

maya.standalone.uninitialize()
os._exit(0)

However, If i'm using nose2 to run my tests, It does not execute this code after the test, and will just crash. And if i put this code in the tear down it doesnt print out the results.

if __name__ == '__main__':
    import nose2
    import maya.standalone
    # Use maya.py for interpreting.
    os.environ['PYTHONPATH'] = r'C:\Program Files\Autodesk\Maya2017\bin'
    # Initialize maya.
    try:
        maya.standalone.initialize(name='python')
    except:
        pass
    nose2.main()
    maya.standalone.uninitialize() # Doesn't execute
    os._exit(0)

Does anyone have a solution for this? In maya 2015 this worked out fine, but using Maya 2017 it crashes. I'm not sure what is going on.

Stack trace:
  MC3.dll!CMLObject::operator=
  MC3.dll!CMLObject::operator=
  MC3.dll!CMLObject::operator=
  MC3.dll!CMLObject::operator=
  MC3.dll!CMLObject::operator=
  MC3.dll!CMLObject::operator=
  MC3.dll!CMLObject::operator=
  MC3.dll!CMLObject::operator=
  MC3.dll!CMLObject::operator=
  MC3.dll!CMLObject::operator=
  MC3.dll!GetUnitTypeString
  MC3.dll!CMLWaypoint::Create
  MC3.dll!CMLWaypoint::Create
  ntdll.dll!LdrShutdownProcess
  ntdll.dll!RtlExitUserProcess
  MSVCR110.dll!_initterm_e
  python27.dll!PyErr_Print
  python27.dll!PyErr_PrintEx
  python27.dll!PyRun_SimpleFileExFlags
  python27.dll!PyRun_AnyFileExFlags
  python27.dll!Py_Main
  kernel32.dll!BaseThreadInitThunk
  ntdll.dll!RtlUserThreadStart

Aucun commentaire:

Enregistrer un commentaire