Closed Haxrox closed 1 year ago
https://github.com/WorldofKerry/Python2Verilog/blob/40d923ea1de83a5505b59e690a42e6ebeb956ef6/python2verilog/optimizer/optimizer.py#L58-L61
When is RecursionError raised? From https://docs.python.org/3/library/copy.html#module-copy, it doesn't seem like copy.copy ever raises an Exception.
RecursionError
Also, if you're going to wrap the Exception thrown, maybe be more descriptive. I.e. something like: "Cannot shallow copy {node}"
I think that was a relic from when I used copy.deepcopy instead, where cyclic structures would cause an recursion error. I'll remove this try-catch.
copy.deepcopy
https://github.com/WorldofKerry/Python2Verilog/blob/40d923ea1de83a5505b59e690a42e6ebeb956ef6/python2verilog/optimizer/optimizer.py#L58-L61
When is
RecursionError
raised? From https://docs.python.org/3/library/copy.html#module-copy, it doesn't seem like copy.copy ever raises an Exception.Also, if you're going to wrap the Exception thrown, maybe be more descriptive. I.e. something like: "Cannot shallow copy {node}"