diff --git a/lib/ansible/executor/module_common.py b/lib/ansible/executor/module_common.py index 9e25b8446c..3714ae5316 100644 --- a/lib/ansible/executor/module_common.py +++ b/lib/ansible/executor/module_common.py @@ -345,7 +345,7 @@ if __name__ == '__main__': finally: try: shutil.rmtree(temp_path) - except OSError: + except (NameError, OSError): # tempdir creation probably failed pass sys.exit(exitcode)