easybuild.tools.py2vs3.py3 module¶
Functionality to facilitate keeping code compatible with Python 2 & Python 3.
Implementations for Python 3.
Authors:
- Kenneth Hoste (Ghent University)
-
easybuild.tools.py2vs3.py3.extract_method_name(method_func)¶ Extract method name from lambda function.
-
easybuild.tools.py2vs3.py3.json_loads(body)¶ Wrapper for json.loads that takes into account that Python versions older than 3.6 require a string value.
-
easybuild.tools.py2vs3.py3.mk_wrapper_baseclass(metaclass)¶
-
easybuild.tools.py2vs3.py3.raise_with_traceback(exception_class, message, traceback)¶ Raise exception of specified class with given message and traceback.
-
easybuild.tools.py2vs3.py3.safe_cmp_looseversions(v1, v2)¶ Safe comparison function for two (values containing) LooseVersion instances.
-
easybuild.tools.py2vs3.py3.sort_looseversions(looseversions)¶ Sort list of (values including) distutils.version.LooseVersion instances.
-
easybuild.tools.py2vs3.py3.subprocess_popen_text(cmd, **kwargs)¶ Call subprocess.Popen in text mode with specified named arguments.
-
easybuild.tools.py2vs3.py3.subprocess_terminate(proc, timeout)¶ Terminate the subprocess if it hasn’t finished after the given timeout