From f6448e5d65c349576df6e83b8324b9c208e77615 Mon Sep 17 00:00:00 2001
From: Victor Stinner <victor.stinner@gmail.com>
Date: Tue, 25 Apr 2017 02:11:09 +0200
Subject: [PATCH] bpo-30132: distutils test_build_ext() uses temp_cwd() (#1278)

test_build_ext() of test_distutils now uses support.temp_cwd() to
prevent the creation of a pdb file in the current working directory
on Windows.
---
 Lib/distutils/tests/test_build_ext.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index be7f5f38aa..96e5f03095 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -41,6 +41,13 @@ class BuildExtTestCase(TempdirManager,
         return build_ext(*args, **kwargs)
 
     def test_build_ext(self):
+        # bpo-30132: On Windows, a .pdb file may be created in the current
+        # working directory. Create a temporary working directory to cleanup
+        # everything at the end of the test.
+        with support.temp_cwd():
+            self._test_build_ext()
+
+    def _test_build_ext(self):
         cmd = support.missing_compiler_executable()
         if cmd is not None:
             self.skipTest('The %r command is not found' % cmd)
-- 
2.40.0