def osx_shutdown():
 try:
  subprocess.call(['osascript', '-e', 'tell app "System Events" to shut down'])
 except:
  logging.error(T('Error while shutting down system'))
  logging.info('Traceback: ', exc_info=True)
 os._exit(0)

def osx_shutdown ( ) : try : subprocess . call ( [ 'osascript' , '-e' , 'tell app "System Events" to shut down' ] ) except : logging . error ( T ( 'Error while shutting down system' ) ) logging . info ( 'Traceback: ' , exc_info = True ) os . _exit ( 0 )
shutdown osx system .