]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34579: Fix test_embed DEFAULT_CON AIX (GH-9063)
authorMichael Felt <aixtools@users.noreply.github.com>
Sat, 15 Sep 2018 09:28:31 +0000 (11:28 +0200)
committerVictor Stinner <vstinner@redhat.com>
Sat, 15 Sep 2018 09:28:31 +0000 (02:28 -0700)
* Modify DEFAULT_CONFIG for AIX

* bedevere/news did not like old name

* Modify NEWS entry

* Modified per peer review

* Define and use NULL_STR constant to account for AIX libc behavior

* Modify per peer review

* Modify NEWS

Lib/test/test_embed.py
Misc/NEWS.d/next/Tests/2018-09-04-15-16-42.bpo-34579.bp4HdM.rst [new file with mode: 0644]

index 9155c40f405ed08599634ae5c9d094006f6beabc..80233a54b0b02a13e96cf0866fe53e850c55f54b 100644 (file)
@@ -4,11 +4,15 @@ import unittest
 
 from collections import namedtuple
 import os
+import platform
 import re
 import subprocess
 import sys
 
 
+# AIX libc prints an empty string as '' rather than the string '(null)'
+NULL_STR = '' if platform.system() == 'AIX' else '(null)'
+
 class EmbeddingTestsMixin:
     def setUp(self):
         here = os.path.abspath(__file__)
@@ -258,7 +262,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
         'use_environment': 1,
         'use_hash_seed': 0,
         'hash_seed': 0,
-        'allocator': '(null)',
+        'allocator': NULL_STR,
         'dev_mode': 0,
         'faulthandler': 0,
         'tracemalloc': 0,
@@ -276,11 +280,11 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
         'coerce_c_locale': 0,
         'coerce_c_locale_warn': 0,
 
-        'pycache_prefix': '(null)',
+        'pycache_prefix': NULL_STR,
         'program_name': './_testembed',
         'argc': 0,
         'argv': '[]',
-        'program': '(null)',
+        'program': NULL_STR,
 
         'isolated': 0,
         'site_import': 1,
diff --git a/Misc/NEWS.d/next/Tests/2018-09-04-15-16-42.bpo-34579.bp4HdM.rst b/Misc/NEWS.d/next/Tests/2018-09-04-15-16-42.bpo-34579.bp4HdM.rst
new file mode 100644 (file)
index 0000000..9e01cc9
--- /dev/null
@@ -0,0 +1,2 @@
+Fix test_embed for AIX
+Patch by Michael Felt