1

I'm trying to use a Logo Language Compiler that uses Ply into the Unity3D environment for an Open Source project https://github.com/ssouzawallace/blocks-programming.

To do so I am using IronPython that is a Python interpreter running in .NET (I need this to run in Uinty3D). There is a bug in IronPython and i found others with the same issue related to the traceback of python script execution.

In resume if I run the Logo Compiler using the official Python interpreter everything goes OK. But in IronPython, when the code pass trough the get_caller_module_dic method it cannot find my pyLex stuff because it cannot reach the second frame level.

In order to resolve the problem I am wondering to pass the proper object or module to the method:

def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,nowarn=0,outputdir="", debuglog=None, errorlog=None):

But I don't know how to do this.

Someone know what can I do?

Thank you very much in advance

Wallace
  • 504
  • 4
  • 19

1 Answers1

0

Found solution here Python: How do I get a reference to a module inside the module itself?

Now I pass the entire script as a module instead hoping the lex and yacc script find my module using the traceback.

Using

import sys current_module = sys.modules[__name__]

Community
  • 1
  • 1
Wallace
  • 504
  • 4
  • 19