projects
/
python_utils.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Hook in pylint to the pre-commit hook and start to fix some of its
[python_utils.git]
/
misc_utils.py
1
#!/usr/bin/env python3
2
3
import os
4
5
6
def is_running_as_root() -> bool:
7
"""Returns True if running as root.
8
9
>>> is_running_as_root()
10
False
11
"""
12
return os.geteuid() == 0
13
14
15
if __name__ == '__main__':
16
import doctest
17
18
doctest.testmod()