for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
#!/usr/bin/env python3
"""This module is used for backwards compatibility for older Python 3."""
__author__ = "Thurask"
__license__ = "WTFPL v2"
__copyright__ = "2015-2018 Thurask"
def enum_cpus():
"""
Backwards compatibility wrapper for CPU count.
try:
from os import cpu_count
except ImportError:
from multiprocessing import cpu_count
finally:
cpus = cpu_count()
return cpus
def where_which(path):
Backwards compatibility wrapper for approximating which/where.
:param path: Path to a file.
:type path: str
from shutil import which
from shutilwhich import which
thepath = which(path)
return thepath