diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 7c0edfea4f9..1c370dcafa9 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -815,6 +815,9 @@ class CGIHTTPServerTestCase(BaseTestCase): os.rmdir(self.cgi_dir_in_sub_dir) os.rmdir(self.sub_dir_2) os.rmdir(self.sub_dir_1) + # The 'gmon.out' file can be written in the current working + # directory if C-level code profiling with gprof is enabled. + os_helper.unlink(os.path.join(self.parent_dir, 'gmon.out')) os.rmdir(self.parent_dir) finally: BaseTestCase.tearDown(self)