def shutting_down(globals=globals):
 v = globals().get('_shutting_down')
 return ((v is True) or (v is None))

def shutting_down ( globals = globals ) : v = globals ( ) . get ( '_shutting_down' ) return ( ( v is True ) or ( v is None ) )
whether the interpreter is currently shutting down .