Skip to content

Commit 2df025f

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into enable_androidx
2 parents b599430 + 92929c4 commit 2df025f

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

pythonforandroid/bootstraps/common/build/jni/application/src/start.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ int main(int argc, char *argv[]) {
229229
" self.__buffer = ''\n"
230230
" def write(self, s):\n"
231231
" s = self.__buffer + s\n"
232-
" lines = s.split(\"\\n\")\n"
232+
" lines = s.split('\\n')\n"
233233
" for l in lines[:-1]:\n"
234-
" androidembed.log(l)\n"
234+
" androidembed.log(l.replace('\\x00', ''))\n"
235235
" self.__buffer = lines[-1]\n"
236236
" def flush(self):\n"
237237
" return\n"

pythonforandroid/recipe.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import sh
1010
import shutil
1111
import fnmatch
12+
import urllib.request
1213
from urllib.request import urlretrieve
1314
from os import listdir, unlink, environ, mkdir, curdir, walk
1415
from sys import stdout
@@ -23,6 +24,11 @@
2324
from pythonforandroid.util import load_source as import_recipe
2425

2526

27+
url_opener = urllib.request.build_opener()
28+
url_orig_headers = url_opener.addheaders
29+
urllib.request.install_opener(url_opener)
30+
31+
2632
class RecipeMeta(type):
2733
def __new__(cls, name, bases, dct):
2834
if name != 'Recipe':
@@ -206,6 +212,8 @@ def report_hook(index, blksize, size):
206212
seconds = 1
207213
while True:
208214
try:
215+
# jqueryui.com returns a 403 w/ the default user agent
216+
url_opener.addheaders = [('User-agent', 'Mozilla/5.0')]
209217
urlretrieve(url, target, report_hook)
210218
except OSError as e:
211219
attempts += 1
@@ -215,6 +223,8 @@ def report_hook(index, blksize, size):
215223
time.sleep(seconds)
216224
seconds *= 2
217225
continue
226+
finally:
227+
url_opener.addheaders = url_orig_headers
218228
break
219229
return target
220230
elif parsed_url.scheme in ('git', 'git+file', 'git+ssh', 'git+http', 'git+https'):

pythonforandroid/recipes/groestlcoin_hash/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class GroestlcoinHashRecipe(CythonRecipe):
55
version = '1.0.1'
66
url = 'https://github.com/Groestlcoin/groestlcoin-hash-python/archive/{version}.tar.gz'
7-
depends = []
7+
depends = ['setuptools']
88
cythonize = False
99

1010

pythonforandroid/recipes/sdl2_ttf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class LibSDL2TTF(BootstrapNDKRecipe):
5-
version = '2.0.14'
5+
version = '2.0.15'
66
url = 'https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-{version}.tar.gz'
77
dir_name = 'SDL2_ttf'
88

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
packages = find_packages()
1212

1313
package_data = {'': ['*.tmpl',
14-
'*.patch', ], }
14+
'*.patch',
15+
'*.diff', ], }
1516

1617
data_files = []
1718

0 commit comments

Comments
 (0)