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

Skip to content

Commit 4454a1f

Browse files
committed
Fix building of spwd; was incorrectly checking for the needed HAVE_* values to
properly build the module. Also moved up the creation of config_h_vars (from distutils.sysconfig.parse_config_h()) higher on up in detect_modules() so that it can be used sooner).
1 parent 1356f78 commit 4454a1f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ def detect_modules(self):
295295
inc_dirs = self.compiler.include_dirs + ['/usr/include']
296296
exts = []
297297

298+
config_h = sysconfig.get_config_h_filename()
299+
config_h_vars = sysconfig.parse_config_h(open(config_h))
300+
298301
platform = self.get_platform()
299302
(srcdir,) = sysconfig.get_config_vars('srcdir')
300303

@@ -391,8 +394,8 @@ def detect_modules(self):
391394
# grp(3)
392395
exts.append( Extension('grp', ['grpmodule.c']) )
393396
# spwd, shadow passwords
394-
if (sysconfig.get_config_var('HAVE_GETSPNAM') or
395-
sysconfig.get_config_var('HAVE_GETSPENT')):
397+
if (config_h_vars.get('HAVE_GETSPNAM', False) or
398+
config_h_vars.get('HAVE_GETSPENT', False)):
396399
exts.append( Extension('spwd', ['spwdmodule.c']) )
397400
# select(2); not on ancient System V
398401
exts.append( Extension('select', ['selectmodule.c']) )
@@ -785,8 +788,6 @@ class db_found(Exception): pass
785788
('BYTEORDER', xmlbo),
786789
('XML_CONTEXT_BYTES','1024'),
787790
]
788-
config_h = sysconfig.get_config_h_filename()
789-
config_h_vars = sysconfig.parse_config_h(open(config_h))
790791
for feature_macro in ['HAVE_MEMMOVE', 'HAVE_BCOPY']:
791792
if config_h_vars.has_key(feature_macro):
792793
define_macros.append((feature_macro, '1'))

0 commit comments

Comments
 (0)