From 259c159fc1faab0dd631d20374842dc0d6a9f145 Mon Sep 17 00:00:00 2001 From: Michael Felt Date: Wed, 26 Dec 2018 06:45:19 +0100 Subject: [PATCH] bpo-34897: avoid distutils test error when CXX is not set (GH-9706) Depending on system config, a missing candidate compiler name may be reported as the empty string rather than as None, so adjust the test helper accordingly. --- Lib/test/support/__init__.py | 2 +- .../next/Library/2018-10-04-20-25-35.bpo-34897.rNE2Cy.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2018-10-04-20-25-35.bpo-34897.rNE2Cy.rst diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 53119e138cf..dd1790d592b 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2783,7 +2783,7 @@ def missing_compiler_executable(cmd_names=[]): if cmd_names: assert cmd is not None, \ "the '%s' executable is not configured" % name - elif cmd is None: + elif not cmd: continue if spawn.find_executable(cmd[0]) is None: return cmd[0] diff --git a/Misc/NEWS.d/next/Library/2018-10-04-20-25-35.bpo-34897.rNE2Cy.rst b/Misc/NEWS.d/next/Library/2018-10-04-20-25-35.bpo-34897.rNE2Cy.rst new file mode 100644 index 00000000000..f25349659ca --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-04-20-25-35.bpo-34897.rNE2Cy.rst @@ -0,0 +1,2 @@ +Adjust test.support.missing_compiler_executable check so that a nominal +command name of "" is ignored. Patch by Michael Felt.