devbisme / pygmyhdl

MyHDL hardware design language encased in the tasty PygMyHDL wrapper.
MIT License
19 stars 6 forks source link

import error from byteplay3 #1

Closed GProtoZeroW closed 3 years ago

GProtoZeroW commented 6 years ago

Dave, tried to start using your pygmyhdl. did a pip install of it and got the following

from pygmyhdl import *
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-1dc80c27a242> in <module>()
----> 1 from pygmyhdl import *

~/anaconda3/lib/python3.6/site-packages/pygmyhdl/__init__.py in <module>()
     37 from myhdl import *
     38 from myhdlpeek import *
---> 39 from .pygmyhdl import *
     40 from .pckg_info import version

~/anaconda3/lib/python3.6/site-packages/pygmyhdl/pygmyhdl.py in <module>()
     50 
     51 if USING_PYTHON3:
---> 52     import byteplay3 as bp
     53 else:
     54     import byteplay as bp

~/anaconda3/lib/python3.6/site-packages/byteplay3.py in <module>()
    398 # ..refer to a code object at TOS1 with function name at TOS
    399 
--> 400 hascode = set( [ Opcode(MAKE_FUNCTION), Opcode(MAKE_CLOSURE) ] )
    401 
    402 # ..may not continue to the next sequential instruction

NameError: name 'MAKE_CLOSURE' is not defined
xesscorp commented 6 years ago

Apologies for my late reply.

I'm getting the same error when I try the import in Python 3.6. It works correctly in Python 3.5. byteplay works with the opcodes in Python and those may change from version to version, so the MAKE_CLOSURE opcode has probably disappeared. I'll see if I can find a solution.

xesscorp commented 6 years ago

I tried a simple fix to byteplay3, but it just moved the problem to another section of the code where another simple fix is not obvious. So I'll need to dig through byteplay3 in detail or find another module that does what it does.

The only immediate (and unsatisfying) solution I have for you is to use Python 3.5.