fix for exception catching with stdin as filename by None

Signed-off-by: Mattias Andrée <maandree@operamail.com>