···
1
+
diff -ru -x '*~' Python-2.7.11-orig/Lib/ctypes/util.py Python-2.7.11/Lib/ctypes/util.py
2
+
--- Python-2.7.11-orig/Lib/ctypes/util.py 2015-12-05 20:46:56.000000000 +0100
3
+
+++ Python-2.7.11/Lib/ctypes/util.py 2016-07-01 14:24:50.714223450 +0200
7
+
def _findSoname_ldconfig(name):
9
+
- if struct.calcsize('l') == 4:
10
+
- machine = os.uname()[4] + '-32'
12
+
- machine = os.uname()[4] + '-64'
14
+
- 'x86_64-64': 'libc6,x86-64',
15
+
- 'ppc64-64': 'libc6,64bit',
16
+
- 'sparc64-64': 'libc6,64bit',
17
+
- 's390x-64': 'libc6,64bit',
18
+
- 'ia64-64': 'libc6,IA-64',
20
+
- abi_type = mach_map.get(machine, 'libc6')
22
+
- # XXX assuming GLIBC's ldconfig (with option -p)
23
+
- expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
24
+
- f = os.popen('/sbin/ldconfig -p 2>/dev/null')
29
+
- res = re.search(expr, data)
32
+
- return res.group(1)
35
+
def find_library(name):
36
+
return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
37
+
diff -ru -x '*~' Python-2.7.11-orig/Lib/uuid.py Python-2.7.11/Lib/uuid.py
38
+
--- Python-2.7.11-orig/Lib/uuid.py 2015-12-05 20:47:09.000000000 +0100
39
+
+++ Python-2.7.11/Lib/uuid.py 2016-07-01 14:33:14.360446897 +0200
40
+
@@ -437,57 +437,7 @@
41
+
return ((bytes[0]<<40L) + (bytes[1]<<32L) + (bytes[2]<<24L) +
42
+
(bytes[3]<<16L) + (bytes[4]<<8L) + bytes[5])
44
+
-# Thanks to Thomas Heller for ctypes and for his help with its use here.
46
+
-# If ctypes is available, use it to find system routines for UUID generation.
47
+
_uuid_generate_time = _UuidCreate = None
49
+
- import ctypes, ctypes.util
52
+
- # The uuid_generate_* routines are provided by libuuid on at least
53
+
- # Linux and FreeBSD, and provided by libc on Mac OS X.
54
+
- _libnames = ['uuid']
55
+
- if not sys.platform.startswith('win'):
56
+
- _libnames.append('c')
57
+
- for libname in _libnames:
59
+
- lib = ctypes.CDLL(ctypes.util.find_library(libname))
62
+
- if hasattr(lib, 'uuid_generate_time'):
63
+
- _uuid_generate_time = lib.uuid_generate_time
67
+
- # The uuid_generate_* functions are broken on MacOS X 10.5, as noted
68
+
- # in issue #8621 the function generates the same sequence of values
69
+
- # in the parent process and all children created using fork (unless
70
+
- # those children use exec as well).
72
+
- # Assume that the uuid_generate functions are broken from 10.5 onward,
73
+
- # the test can be adjusted when a later version is fixed.
74
+
- if sys.platform == 'darwin':
76
+
- if int(os.uname()[2].split('.')[0]) >= 9:
77
+
- _uuid_generate_time = None
79
+
- # On Windows prior to 2000, UuidCreate gives a UUID containing the
80
+
- # hardware address. On Windows 2000 and later, UuidCreate makes a
81
+
- # random UUID and UuidCreateSequential gives a UUID containing the
82
+
- # hardware address. These routines are provided by the RPC runtime.
83
+
- # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last
84
+
- # 6 bytes returned by UuidCreateSequential are fixed, they don't appear
85
+
- # to bear any relationship to the MAC address of any network device
88
+
- lib = ctypes.windll.rpcrt4
91
+
- _UuidCreate = getattr(lib, 'UuidCreateSequential',
92
+
- getattr(lib, 'UuidCreate', None))
96
+
def _unixdll_getnode():
97
+
"""Get the hardware address on Unix using ctypes."""