This repository has been archived on 2025-06-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
fl0w-old/Shared/Utils.py
2016-04-04 13:13:28 +02:00

18 lines
No EOL
535 B
Python

from traceback import print_exception
from sys import exc_info
import platform
def capture_trace():
exc_type, exc_value, exc_traceback = exc_info()
print_exception(exc_type, exc_value, exc_traceback)
def is_socket_related_error(error):
if type(error) not in (BrokenPipeError, ConnectionResetError, OSError):
return False
if type(error) is OSError:
if str(error) not in ("Connection closed", "[Errno 9] Bad file descriptor"):
return False
return True
def is_wallaby():
return "3.18.21-custom" in platform.uname().release