Which version of Python?
Closed this issue · 2 comments
donkirkby commented
Thanks for building this demo, but I can't get it to work for me. I saw that the cookiecutter templates are different for different Python versions, so I thought maybe that matters for your app. Which Python version did you run it with?
I'm using Python 3.5.2, and I've narrowed down the error to a generator expression. I replaced the MyApp.play()
method with this:
def play(self, i, j):
letters = ['a', 'b', 'c']
print('calc letters')
print(any(x == 'd' for x in letters))
print('Done.')
When I tap on a square, I see this in my logcat:
04-02 22:34:44.918 23051-23051/org.pybee.demo.tictactoe I/Python: calc letters
04-02 22:34:44.926 23051-23051/org.pybee.demo.tictactoe D/AndroidRuntime: Shutting down VM
04-02 22:34:44.932 23051-23051/org.pybee.demo.tictactoe E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.pybee.demo.tictactoe, PID: 23051
RuntimeError: python.tictactoe.app.MyApp.genexp_7f3d89a9e1d0
at java.lang.reflect.Method.invoke(Native Method)
at org.python.types.Function.invoke(Function.java:388)
at org.python.types.Method.invoke(Method.java:47)
at python.tictactoe.app.ButtonClick.onClick$py(app.py:18)
at python.tictactoe.app.ButtonClick.onClick(app.py)
at android.view.View.performClick(View.java:6306)
at android.widget.TextView.performClick(TextView.java:11201)
at android.view.View$PerformClick.run(View.java:23962)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1557)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
eliasdorneles commented
Hello!
It seems that the problem is this bug:
beeware/voc#717
Can you try with VOC 0.1.4?
Le mar. 3 avr. 2018 à 07:41, Don Kirkby <notifications@github.com> a écrit :
… Thanks for building this demo, but I can't get it to work for me. I saw
that the cookiecutter templates are different for different Python
versions, so I thought maybe that matters for your app. Which Python
version did you run it with?
I'm using Python 3.5.2, and I've narrowed down the error to a generator
expression. I replaced the MyApp.play() method with this:
def play(self, i, j):
letters = ['a', 'b', 'c']
print('calc letters')
print(any(x == 'd' for x in letters))
print('Done.')
When I tap on a square, I see this in my logcat:
04-02 22:34:44.918 23051-23051/org.pybee.demo.tictactoe I/Python: calc letters
04-02 22:34:44.926 23051-23051/org.pybee.demo.tictactoe D/AndroidRuntime: Shutting down VM
04-02 22:34:44.932 23051-23051/org.pybee.demo.tictactoe E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.pybee.demo.tictactoe, PID: 23051
RuntimeError: python.tictactoe.app.MyApp.genexp_7f3d89a9e1d0
at java.lang.reflect.Method.invoke(Native Method)
at org.python.types.Function.invoke(Function.java:388)
at org.python.types.Method.invoke(Method.java:47)
at python.tictactoe.app.ButtonClick.onClick$py(app.py:18)
at python.tictactoe.app.ButtonClick.onClick(app.py)
at android.view.View.performClick(View.java:6306)
at android.widget.TextView.performClick(TextView.java:11201)
at android.view.View$PerformClick.run(View.java:23962)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1557)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AACSvSs4sXzSUJnrpcfBUNAt1oyWjYq3ks5tkwuXgaJpZM4TEewr>
.
donkirkby commented
Thanks, that fixed it for me. I created a pull request, in case you want to pin the voc version to help others avoid this problem.