- twtfile = open(session.twtfile, "w")
- except PermissionError, FileNotFoundError:
- notice("CAN'T ACCESS OR CREATE TWT FILE.")
+ twtfile = open(session.twtfile, mode)
+ except (PermissionError, FileNotFoundError) as err:
+ notice("CAN'T ACCESS OR CREATE TWT FILE: " + str(err))