Make exception handling in screen selection compatible across Python 2.x/3.x

Signed-off-by: Ramasamy Chandramouli <rsmouli@gmail.com>