Changes:

Wrapped scanlines in try block,
Fixed Py2 compatibility for test usage,
Changed commands to run test script