kosarev / zx

ZX Spectrum emulator written in a mix of Python and C++
https://twitter.com/z80tools
MIT License
21 stars 1 forks source link

EmulationExit exception is protected #17

Closed boriel closed 3 years ago

boriel commented 3 years ago

If one wants to catch EmulationExit exception, s/he has to write:

from zx._except import EmulationExit

The member _except is prefixed with _ and marked as "protected". Of course it works, but many linters complain with "accessing a protected member". Could it be possible to have exceptions in the zx namespace? (I can issue you a PR :) )

kosarev commented 3 years ago

Yeah, I wasn't sure about the name of the exception and decided to postpone making it public for now. Looking at the standard Python 3 exceptions, we already have SystemExit and GeneratorExit, and EmulationExit is not quite an interrupt kind of exception (we in fact might want to have EmulationInterrupt in the future, I can imagine), so time showed no concerns about the name, it seems. Will prepare a patch in a minute. Thanks. : )

kosarev commented 3 years ago

@boriel Done. Please check on your side.

boriel commented 3 years ago

Works ok!! Thanks! :)