"""Provides `subprocess.run()` from Python 3.5+ if available. Otherwise falls back to `subprocess.check_output()`."""

try:
    from subprocess import run
except ImportError:
    from collections import namedtuple
    from subprocess import check_output

    def run(args, *, stdin=None, input=None, stdout=None, stderr=None, shell=False, timeout=None, check=False,
            encoding=None, errors=None):
        stdout_bytes = check_output(args, stdin=stdin, stderr=stderr, shell=shell, timeout=timeout)
        Output = namedtuple('Output', ['stdout'])
        return Output(stdout=stdout_bytes)

@@ -246,17 +246,37 @@
 k_output
+, CalledProcessError
 %0A
-
 %0A    def
@@ -420,16 +420,33 @@
 =None):%0A
+        try:%0A    
         
@@ -537,16 +537,158 @@
 imeout)%0A
+        except CalledProcessError as e:%0A            if check:%0A                raise%0A            else:%0A                stdout_bytes = e.output%0A
         

Fix throwing error although check arg is false