5
"""Return the current OS platform.
7
For example: if current os platform is Ubuntu then a string "ubuntu"
8
will be returned (which is the name of the module).
9
This string is used to decide which platform module should be imported.
11
# linux_distribution is deprecated and will be removed in Python 3.7
12
# Warings *not* disabled, as we certainly need to fix this.
13
tuple_platform = platform.linux_distribution()
14
current_platform = tuple_platform[0]
15
if "Ubuntu" in current_platform:
17
elif "CentOS" in current_platform:
19
elif "debian" in current_platform:
20
# Stock Python does not detect Ubuntu and instead returns debian.
21
# Or at least it does in some build environments like Travis CI
24
raise RuntimeError("This module is not supported on {}."
25
.format(current_platform))