Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Side by Side Diff: Lib/distutils/sysconfig.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/distutils/spawn.py ('k') | Lib/distutils/tests/test_build_ext.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """Provide access to Python's configuration information. The specific 1 """Provide access to Python's configuration information. The specific
2 configuration variables available depend heavily on the platform and 2 configuration variables available depend heavily on the platform and
3 configuration. The values may be retrieved using 3 configuration. The values may be retrieved using
4 get_config_var(name), and the list of variables is available via 4 get_config_var(name), and the list of variables is available via
5 get_config_vars().keys(). Additional convenience functions are also 5 get_config_vars().keys(). Additional convenience functions are also
6 available. 6 available.
7 7
8 Written by: Fred L. Drake, Jr. 8 Written by: Fred L. Drake, Jr.
9 Email: <fdrake@acm.org> 9 Email: <fdrake@acm.org>
10 """ 10 """
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 try: 411 try:
412 filename = get_config_h_filename() 412 filename = get_config_h_filename()
413 with open(filename) as file: 413 with open(filename) as file:
414 parse_config_h(file, g) 414 parse_config_h(file, g)
415 except IOError as msg: 415 except IOError as msg:
416 my_msg = "invalid Python installation: unable to open %s" % filename 416 my_msg = "invalid Python installation: unable to open %s" % filename
417 if hasattr(msg, "strerror"): 417 if hasattr(msg, "strerror"):
418 my_msg = my_msg + " (%s)" % msg.strerror 418 my_msg = my_msg + " (%s)" % msg.strerror
419 419
420 raise DistutilsPlatformError(my_msg) 420 raise DistutilsPlatformError(my_msg)
421
422 # On MacOSX we need to check the setting of the environment variable
423 # MACOSX_DEPLOYMENT_TARGET: configure bases some choices on it so
424 # it needs to be compatible.
425 # If it isn't set we set it to the configure-time value
426 if sys.platform == 'darwin' and 'MACOSX_DEPLOYMENT_TARGET' in g:
427 cfg_target = g['MACOSX_DEPLOYMENT_TARGET']
428 cur_target = os.getenv('MACOSX_DEPLOYMENT_TARGET', '')
429 if cur_target == '':
430 cur_target = cfg_target
431 os.environ['MACOSX_DEPLOYMENT_TARGET'] = cfg_target
432 elif [int(x) for x in cfg_target.split('.')] > [int(x) for x in cur_targ et.split('.')]:
433 my_msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" dur ing configure'
434 % (cur_target, cfg_target))
435 raise DistutilsPlatformError(my_msg)
421 436
422 # On AIX, there are wrong paths to the linker scripts in the Makefile 437 # On AIX, there are wrong paths to the linker scripts in the Makefile
423 # -- these paths are relative to the Python source, but when installed 438 # -- these paths are relative to the Python source, but when installed
424 # the scripts are in another directory. 439 # the scripts are in another directory.
425 if python_build: 440 if python_build:
426 g['LDSHARED'] = g['BLDSHARED'] 441 g['LDSHARED'] = g['BLDSHARED']
427 442
428 elif get_python_version() < '2.1': 443 elif get_python_version() < '2.1':
429 # The following two branches are for 1.5.2 compatibility. 444 # The following two branches are for 1.5.2 compatibility.
430 if sys.platform == 'aix4': # what about AIX 3.x ? 445 if sys.platform == 'aix4': # what about AIX 3.x ?
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 return vals 574 return vals
560 else: 575 else:
561 return _config_vars 576 return _config_vars
562 577
563 def get_config_var(name): 578 def get_config_var(name):
564 """Return the value of a single variable using the dictionary 579 """Return the value of a single variable using the dictionary
565 returned by 'get_config_vars()'. Equivalent to 580 returned by 'get_config_vars()'. Equivalent to
566 get_config_vars().get(name) 581 get_config_vars().get(name)
567 """ 582 """
568 return get_config_vars().get(name) 583 return get_config_vars().get(name)
OLDNEW
« no previous file with comments | « Lib/distutils/spawn.py ('k') | Lib/distutils/tests/test_build_ext.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+