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

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

Issue 17086: backport cross-build patches to the 2.7 branch
Patch Set: Created 6 years, 4 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/sysconfig.py ('k') | Lib/plat-generic/regen » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """distutils.util 1 """distutils.util
2 2
3 Miscellaneous utility functions -- anything that doesn't fit into 3 Miscellaneous utility functions -- anything that doesn't fit into
4 one of the other *util.py modules. 4 one of the other *util.py modules.
5 """ 5 """
6 6
7 __revision__ = "$Id$" 7 __revision__ = "$Id$"
8 8
9 import sys, os, string, re 9 import sys, os, string, re
10 from distutils.errors import DistutilsPlatformError 10 from distutils.errors import DistutilsPlatformError
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 i = string.find(sys.version, prefix) 43 i = string.find(sys.version, prefix)
44 if i == -1: 44 if i == -1:
45 return sys.platform 45 return sys.platform
46 j = string.find(sys.version, ")", i) 46 j = string.find(sys.version, ")", i)
47 look = sys.version[i+len(prefix):j].lower() 47 look = sys.version[i+len(prefix):j].lower()
48 if look=='amd64': 48 if look=='amd64':
49 return 'win-amd64' 49 return 'win-amd64'
50 if look=='itanium': 50 if look=='itanium':
51 return 'win-ia64' 51 return 'win-ia64'
52 return sys.platform 52 return sys.platform
53
54 # Set for cross builds explicitly
55 if "_PYTHON_HOST_PLATFORM" in os.environ:
56 return os.environ["_PYTHON_HOST_PLATFORM"]
53 57
54 if os.name != "posix" or not hasattr(os, 'uname'): 58 if os.name != "posix" or not hasattr(os, 'uname'):
55 # XXX what about the architecture? NT is Intel or Alpha, 59 # XXX what about the architecture? NT is Intel or Alpha,
56 # Mac OS is M68k or PPC, etc. 60 # Mac OS is M68k or PPC, etc.
57 return sys.platform 61 return sys.platform
58 62
59 # Try to distinguish various flavours of Unix 63 # Try to distinguish various flavours of Unix
60 64
61 (osname, host, release, version, machine) = os.uname() 65 (osname, host, release, version, machine) = os.uname()
62 66
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 567
564 # byte_compile () 568 # byte_compile ()
565 569
566 def rfc822_escape (header): 570 def rfc822_escape (header):
567 """Return a version of the string escaped for inclusion in an 571 """Return a version of the string escaped for inclusion in an
568 RFC-822 header, by ensuring there are 8 spaces space after each newline. 572 RFC-822 header, by ensuring there are 8 spaces space after each newline.
569 """ 573 """
570 lines = string.split(header, '\n') 574 lines = string.split(header, '\n')
571 header = string.join(lines, '\n' + 8*' ') 575 header = string.join(lines, '\n' + 8*' ')
572 return header 576 return header
OLDNEW
« no previous file with comments | « Lib/distutils/sysconfig.py ('k') | Lib/plat-generic/regen » ('j') | no next file with comments »

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