WorldofKerry / Python2Verilog

Transpiles a subset of Python functions into synthesizable SystemVerilog.
https://worldofkerry.github.io/Python2Verilog/
GNU General Public License v3.0
1 stars 0 forks source link

copy.copy exception #82

Closed Haxrox closed 1 year ago

Haxrox commented 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.

Also, if you're going to wrap the Exception thrown, maybe be more descriptive. I.e. something like: "Cannot shallow copy {node}"

WorldofKerry commented 1 year ago

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.