Clean up, remove compat with py < 3.6
[pyi2ncommon] / src / call_helpers.py
index 4e945e1..9aa855c 100644 (file)
 #
 # Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
 
-""" Helpers for calling commands, capture their output, return result code
-
-Subprocess library just does not provide all the simplicity we would like
+"""
+Helpers for calling commands, capture their output, return result code.
 
-Stay python2 compatible --> no timeouts
+Subprocess library did not provide all the simplicity we would have liked.
+However, this has since changed, so consider using the easy-to-use builtin
+functions :py:func:`subprocess.run` or :py:func:`subprocess.call` instead.
 """
 
 from subprocess import Popen, PIPE
@@ -55,8 +56,8 @@ def call_and_capture(command, stdin_data=None, split_lines=True,
     :returns: (return_code, stdout, stderr); stdout and stderr are lists of
         text lines (without terminating newlines); if universal_newlines is
         True (default), the lines are of type str, otherwise they are non-
-        unicode text (type str in py2, bytes in py3). If split_lines is False
-        (not default), then stdout and stderr are single multi-line strings
+        unicode text (type bytes). If split_lines is False (not default),
+        then stdout and stderr are single multi-line strings
 
     :raise: OSError (e.g., if command does not exist), ValueError if args are
             invalid; no :py:class:`subprocess.CalledProcessError` nor