Skip to content

Make unistr available in logger #647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2016
Merged

Make unistr available in logger #647

merged 1 commit into from
Feb 18, 2016

Conversation

Konubinix
Copy link
Contributor

Or else the simple example given in the quickstart guide would fail with the log

$ python-for-android create --dist_name=testproject --bootstrap=pygame \
    --requirements=sdl,python2
... lots of correct output ...
[INFO]:    -> running make -j5
           working: Objects/descrobject.c:359:5: warning: missing initializer for field ‘set’ of ‘PyGetSetDef {aka struct PyGetSetDef}’ [-Wmissing-field-initializers]                                                                                                        Traceback (most recent call last):
  File "/home/me/.virtualenvs/sandbox/bin/python-for-android", line 9, in <module>
    load_entry_point('python-for-android', 'console_scripts', 'python-for-android')()
  File "/home/me/test/python-for-android/pythonforandroid/toolchain.py", line 708, in main
    ToolchainCL()
  File "/home/me/test/python-for-android/pythonforandroid/toolchain.py", line 323, in __init__
    getattr(self, args.command)(unknown)
  File "/home/me/test/python-for-android/pythonforandroid/toolchain.py", line 105, in wrapper_func
    build_dist_from_args(ctx, dist, dist_args)
  File "/home/me/test/python-for-android/pythonforandroid/toolchain.py", line 142, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/home/me/test/python-for-android/pythonforandroid/build.py", line 560, in build_recipes
    recipe.build_arch(arch)
  File "/home/me/test/python-for-android/pythonforandroid/recipes/hostpython2/__init__.py", line 42, in build_arch
    shprint(sh.make, '-j5')
  File "/home/me/test/python-for-android/pythonforandroid/logger.py", line 169, in shprint
    shorten_string(msg, msg_width), width=msg_width))
  File "/home/me/test/python-for-android/pythonforandroid/logger.py", line 101, in shorten_string
    if not isinstance(string, unistr):
NameError: global name 'unistr' is not defined
Exception in thread Thread-193 (most likely raised during interpreter shutdown):Exception in thread Thread-194 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

@inclement
Copy link
Member

Ah, sorry, I removed this import because it was causing a circular import failure. This solution is probably fine, but would you be able to merge your py3 check with the six one below it, to avoid duplication? It would further be better to check if six.PY2 rather than if not six.PY3 because, as per your own check, we want to check for everything later than py2 - not special case py3.

@Konubinix
Copy link
Contributor Author

I changed the code. Is it better that way?

inclement added a commit that referenced this pull request Feb 18, 2016
Make unistr available in logger
@inclement inclement merged commit a04d9d3 into kivy:master Feb 18, 2016
@inclement
Copy link
Member

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants