lbry-android-sdk/p4a/pythonforandroid/recipes/python3/patches/python-3.4.2-python-misc.patch
Akinwale Ariwodola 744cfaebc2 Initial commit
2017-08-13 02:24:00 +01:00

86 lines
3.2 KiB
Diff

diff -ru Python-3.3.5/Lib/test/test_pwd.py Python-3.3.5-android/Lib/test/test_pwd.py
--- Python-3.3.5/Lib/test/test_pwd.py 2014-03-09 09:40:19.000000000 +0100
+++ Python-3.3.5-android/Lib/test/test_pwd.py 2014-08-04 22:14:36.000000000 +0200
@@ -6,6 +6,7 @@
class PwdTest(unittest.TestCase):
+ @unittest.skipUnless(hasattr(pwd, 'getpwall'), 'pwd module does not expose getpwall()')
def test_values(self):
entries = pwd.getpwall()
@@ -52,6 +53,7 @@
self.assertIn(pwd.getpwnam(e.pw_name), entriesbyname[e.pw_name])
self.assertIn(pwd.getpwuid(e.pw_uid), entriesbyuid[e.pw_uid])
+ @unittest.skipUnless(hasattr(pwd, 'getpwall'), 'pwd module does not expose getpwall()')
def test_errors(self):
self.assertRaises(TypeError, pwd.getpwuid)
self.assertRaises(TypeError, pwd.getpwuid, 3.14)
diff -ru Python-3.4.2/Modules/python.c Python-3.4.2-android/Modules/python.c
--- Python-3.4.2/Modules/python.c 2015-02-24 22:42:37.000000000 +0100
+++ Python-3.4.2-android/Modules/python.c 2015-02-24 23:04:27.000000000 +0100
@@ -44,10 +44,13 @@
fpsetmask(m & ~FP_X_OFL);
#endif
- oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));
- if (!oldloc) {
- fprintf(stderr, "out of memory\n");
- return 1;
+ oldloc = setlocale(LC_ALL, NULL);
+ if (oldloc) {
+ oldloc = _PyMem_RawStrdup(oldloc);
+ if (!oldloc) {
+ fprintf(stderr, "out of memory\n");
+ return 1;
+ }
}
setlocale(LC_ALL, "");
@@ -64,8 +67,11 @@
}
argv_copy2[argc] = argv_copy[argc] = NULL;
- setlocale(LC_ALL, oldloc);
- PyMem_RawFree(oldloc);
+ if (oldloc) {
+ setlocale(LC_ALL, oldloc);
+ PyMem_RawFree(oldloc);
+ }
+
res = Py_Main(argc, argv_copy);
for (i = 0; i < argc; i++) {
PyMem_RawFree(argv_copy2[i]);
diff -ru Python-3.3.5/setup.py Python-3.3.5-android/setup.py
--- Python-3.3.5/setup.py 2014-03-09 09:40:35.000000000 +0100
+++ Python-3.3.5-android/setup.py 2014-08-04 22:14:36.000000000 +0200
@@ -562,7 +562,7 @@
libraries=math_libs) )
# time libraries: librt may be needed for clock_gettime()
- time_libs = []
+ time_libs = ['m']
lib = sysconfig.get_config_var('TIMEMODULE_LIB')
if lib:
time_libs.append(lib)
@@ -639,7 +639,8 @@
# Operations on audio samples
# According to #993173, this one should actually work fine on
# 64-bit platforms.
- exts.append( Extension('audioop', ['audioop.c']) )
+ exts.append( Extension('audioop', ['audioop.c'],
+ libraries=['m']) )
# readline
do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
@@ -1904,7 +1905,8 @@
sources=sources,
depends=depends)
ext_test = Extension('_ctypes_test',
- sources=['_ctypes/_ctypes_test.c'])
+ sources=['_ctypes/_ctypes_test.c'],
+ libraries=['m'])
self.extensions.extend([ext, ext_test])
if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):