Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d206731

Browse files
aixtoolsvstinner
authored andcommitted
bpo-34579: Fix test_embed DEFAULT_CON AIX (GH-9063)
* 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
1 parent 3d07349 commit d206731

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

Lib/test/test_embed.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44

55
from collections import namedtuple
66
import os
7+
import platform
78
import re
89
import subprocess
910
import sys
1011

1112

13+
# AIX libc prints an empty string as '' rather than the string '(null)'
14+
NULL_STR = '' if platform.system() == 'AIX' else '(null)'
15+
1216
class EmbeddingTestsMixin:
1317
def setUp(self):
1418
here = os.path.abspath(__file__)
@@ -258,7 +262,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
258262
'use_environment': 1,
259263
'use_hash_seed': 0,
260264
'hash_seed': 0,
261-
'allocator': '(null)',
265+
'allocator': NULL_STR,
262266
'dev_mode': 0,
263267
'faulthandler': 0,
264268
'tracemalloc': 0,
@@ -276,11 +280,11 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
276280
'coerce_c_locale': 0,
277281
'coerce_c_locale_warn': 0,
278282

279-
'pycache_prefix': '(null)',
283+
'pycache_prefix': NULL_STR,
280284
'program_name': './_testembed',
281285
'argc': 0,
282286
'argv': '[]',
283-
'program': '(null)',
287+
'program': NULL_STR,
284288

285289
'isolated': 0,
286290
'site_import': 1,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix test_embed for AIX
2+
Patch by Michael Felt

0 commit comments

Comments
 (0)