From 6a1e722cc4057bfc25dfe81f8b6c7868b451647c Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Wed, 21 Nov 2012 16:10:05 +0100 Subject: [PATCH] fix _scproxy error when importing urllib by adding a fake _scproxy.py --- src/python_files/_scproxy.py | 10 ++++++++++ tools/build-python.sh | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 src/python_files/_scproxy.py diff --git a/src/python_files/_scproxy.py b/src/python_files/_scproxy.py new file mode 100644 index 0000000..2423940 --- /dev/null +++ b/src/python_files/_scproxy.py @@ -0,0 +1,10 @@ +''' +Stub functions for _scproxy on iOS +No proxy is supported yet. +''' + +def _get_proxy_settings(): + return {'exclude_simple': 1} + +def _get_proxies(): + return {} diff --git a/tools/build-python.sh b/tools/build-python.sh index 3905211..f1291c7 100755 --- a/tools/build-python.sh +++ b/tools/build-python.sh @@ -24,6 +24,7 @@ try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-static-_sql # Copy our setup for modules try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local +try cp $KIVYIOSROOT/src/python_files/_scproxy.py Lib/_scproxy.py echo "Building for native machine ============================================" @@ -51,6 +52,7 @@ ln -s "$SDKROOT/usr/lib/libgcc_s.1.dylib" extralibs/libgcc_s.10.4.dylib || echo # Copy our setup for modules try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local +try cp $KIVYIOSROOT/src/python_files/_scproxy.py Lib/_scproxy.py try ./configure CC="$ARM_CC" LD="$ARM_LD" \ CFLAGS="$ARM_CFLAGS" \