summaryrefslogtreecommitdiffstatshomepage
path: root/drivers/display/ssd1306.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-02-24 14:56:37 +1100
committerDamien George <damien.p.george@gmail.com>2017-02-24 14:56:37 +1100
commitf615d82d5b4a8877462ce7c4f511e24c94a7b740 (patch)
treedd961ab3687cfacb77af152faf2bcd52d6566e90 /drivers/display/ssd1306.py
parent5255255fb9ea003db65935fe6cf2ac9d17410faa (diff)
downloadmicropython-f615d82d5b4a8877462ce7c4f511e24c94a7b740.tar.gz
micropython-f615d82d5b4a8877462ce7c4f511e24c94a7b740.zip
py/parse: Simplify handling of errors by raising them directly.
The parser was originally written to work without raising any exceptions and instead return an error value to the caller. But it's now required that a call to the parser be wrapped in an nlr handler, so we may as well make use of that fact and simplify the parser so that it doesn't need to keep track of any memory errors that it had. The parser anyway explicitly raises an exception at the end if there was an error. This patch simplifies the parser by letting the underlying memory allocation functions raise an exception if they fail to allocate any memory. And if there is an error parsing the "<id> = const(<val>)" pattern then that also raises an exception right away instead of trying to recover gracefully and then raise.
Diffstat (limited to 'drivers/display/ssd1306.py')
0 files changed, 0 insertions, 0 deletions