More Python 3 corrections.
* Change: In unicorn/python/unicornInit.py, when iterating over all the loaded modules, now we have "namespace" that have a __file__ attribute which is set to None. Skip them. * Change: In stratus1/st_net.py, "is" must be replaced by "==" when doing string comparison. * Change: In stratus1/st_parser.py, open file in "rb" mode instead of "r" (so we get a bytestream as now required by Python).
This commit is contained in:
parent
0d7deafe81
commit
762e25adde
|
@ -457,13 +457,13 @@ class net :
|
|||
cell._TAB_NETS_OUT += [Signal ( "sh_o%d" % num_net, inputNet._arity )]
|
||||
|
||||
# Initialisation of shiftType
|
||||
if direction is "left" :
|
||||
if type is "logical" : shiftType = 0x12
|
||||
elif type is "arith" : shiftType = 0xa
|
||||
if direction == "left" :
|
||||
if type == "logical" : shiftType = 0x12
|
||||
elif type == "arith" : shiftType = 0xa
|
||||
else : shiftType = 0x6
|
||||
else :
|
||||
if type is "logical" : shiftType = 0x11
|
||||
elif type is "arith" : shiftType = 0x9
|
||||
if type == "logical" : shiftType = 0x11
|
||||
elif type == "arith" : shiftType = 0x9
|
||||
else : shiftType = 0x5
|
||||
|
||||
inst_name = self._st_cell._shift.lower()
|
||||
|
|
|
@ -115,7 +115,7 @@ class Parser :
|
|||
# Parsing a file
|
||||
################
|
||||
def Parse ( self, nameFile ) :
|
||||
self._p.ParseFile ( open ( nameFile, "r" ) )
|
||||
self._p.ParseFile ( open ( nameFile, "rb" ) )
|
||||
|
||||
##################
|
||||
class InitParser :
|
||||
|
|
|
@ -73,6 +73,7 @@ def unicornConfigure ( **kw ):
|
|||
if not 'unicornHook' in module.__dict__:
|
||||
if module.__name__.endswith( '.__pycache__' ): continue
|
||||
if not '__file__' in module.__dict__: continue
|
||||
if module.__file__ is None: continue
|
||||
elements = module.__file__.split( os.sep )
|
||||
if elements[-1] == 'plugins':
|
||||
print( WarningMessage( 'Plugin "{}" do not provides the unicornHook() method, skipped.' \
|
||||
|
|
Loading…
Reference in New Issue