Old style exceptions --> new style exceptions

This commit is contained in:
cclauss
2017-07-19 17:00:14 +02:00
committed by GitHub
parent f4b6b5ae80
commit d032c97b35

View File

@@ -40,7 +40,7 @@ target = sys.argv[1]
conn = MYSMB(target) conn = MYSMB(target)
try: try:
conn.login(USERNAME, PASSWORD) conn.login(USERNAME, PASSWORD)
except smb.SessionError, e: except smb.SessionError as e:
print('Login failed: ' + nt_errors.ERROR_MESSAGES[e.error_code][0]) print('Login failed: ' + nt_errors.ERROR_MESSAGES[e.error_code][0])
sys.exit() sys.exit()
finally: finally:
@@ -70,7 +70,7 @@ for pipe_name, pipe_uuid in pipes.items():
try: try:
dce.bind(pipe_uuid, transfer_syntax=NDR64Syntax) dce.bind(pipe_uuid, transfer_syntax=NDR64Syntax)
print('{}: Ok (64 bit)'.format(pipe_name)) print('{}: Ok (64 bit)'.format(pipe_name))
except DCERPCException, e: except DCERPCException as e:
if 'transfer_syntaxes_not_supported' in str(e): if 'transfer_syntaxes_not_supported' in str(e):
print('{}: Ok (32 bit)'.format(pipe_name)) print('{}: Ok (32 bit)'.format(pipe_name))
else: else: