I wrote this simple code:
#!/usr/bin/python2.7 -tt import subprocess def main() try: process = subprocess.check_output(['unvalidcommand'],shell=True) except CalledProcessError: print 'there is the calledProcessError' if __name__ == '__main__': main() Expected output: there is the calledProcessError
What I got: NameError: global name 'CalledProcessError' is not defined
subprocess.CalledProcessError.