fossasia / pslab-python

Python Library for PSLab Desktop: https://pslab.io
GNU General Public License v3.0
1.62k stars 226 forks source link

Remove custom exception handling #117

Closed bessman closed 4 years ago

bessman commented 4 years ago

This PR removes the custom exception handling discussed in #115. It should not affect normal operation (with one exception, see below).

Additionally, it changes the behavior of ScienceLab.write_bulk_flash() by changing the indentation level if this block:

        # verification by readback
        tmp = [ord(a) for a in self.read_bulk_flash(location, len(data))]
        print('Verification done', tmp == data)
        if tmp != data: raise Exception('Verification by readback failed')

In the current version, this block will never be executed because it comes after a raise statement. This does not seem intentional, so I fixed it. I have not tested it, but since it does not write anything to the hardware it should be safe.

My IDE also autoremoved some trailing whitespace here and there throughout the code.

bessman commented 4 years ago

The Codacy quality issues are not really related to the changes introduces by this PR. I'd rather fix them in a separate PR at a later point.

orangecms commented 4 years ago

The Codacy quality issues are not really related to the changes introduces by this PR. I'd rather fix them in a separate PR at a later point.

Looks like that came with #118. Should be fixed later. :)