Re:Dis This: Disassemble Python code online
by hackan on Tuesday February 14, 2023 @08:25PM
(#34798836)
It's really neat, I like it! It would be nice to catch exceptions, they are currently blowing up, i.e.:
```
ncaught PythonError: Traceback (most recent call last):
File "/lib/python3.11/_pyodide/_base.py", line 460, in eval_code
.run(globals, locals)
^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.11/_pyodide/_base.py", line 306, in run
coroutine = eval(self.code, globals, locals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<exec>", line 7, in <module>
File "<exec>", line 5, in feet_to_meters
ZeroDivisionError: division by zero
```
[ Parent
| on HN ]
Re:Dis This: Disassemble Python code online
by pamelafox on Tuesday February 14, 2023 @08:34PM
(#34798912)
Ah yes, good point, I’ll add exception handling. Thanks!
Re:Dis This: Disassemble Python code online
by pamelafox on Sunday February 19, 2023 @10:18AM
(#34858273)
Fixed, just needed a try/catch:
https://github.com/pamelafox/dis-this/pull/5/files#diff-2765...