decorators: fix class/instance logic
This commit is contained in:
parent
4091af69fd
commit
e702fb7727
|
@ -1,6 +1,7 @@
|
|||
import warnings
|
||||
|
||||
from migen.fhdl.structure import *
|
||||
from migen.fhdl.module import Module
|
||||
from migen.fhdl.tools import insert_reset, rename_clock_domain
|
||||
|
||||
class ModuleTransformer:
|
||||
|
@ -40,10 +41,10 @@ class ModuleTransformer:
|
|||
return victim
|
||||
|
||||
def __call__(self, victim):
|
||||
try:
|
||||
return self.wrap_class(victim)
|
||||
except TypeError:
|
||||
if isinstance(victim, Module):
|
||||
return self.wrap_instance(victim)
|
||||
else:
|
||||
return self.wrap_class(victim)
|
||||
|
||||
@classmethod
|
||||
def adhoc(cls, i, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue