3 # © Copyright 2021-2022, Scott Gasch
5 """Miscellaneous utilities."""
11 def is_running_as_root() -> bool:
12 """Returns True if running as root.
14 >>> is_running_as_root()
17 return os.geteuid() == 0
20 def debugger_is_attached() -> bool:
21 """Return if the debugger is attached"""
23 gettrace = getattr(sys, 'gettrace', lambda: None)
24 return gettrace() is not None
27 if __name__ == '__main__':