Fix flags variable being set
Fix flags variable being set

If an exception is raised, this is thrown:

UnboundLocalError: local variable 'flags' referenced before assignment

Signed-off-by: Ben Firshman <73675debcd8a436be48ec22211dcf44fe0df0a64@firshman.co.uk>

d11wtq/dockerpty