Added fix canvas.py for python3 #11
Merged
MicheleC
merged 1 commits from feat/exampleCanvas
into master
2 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feat/exampleCanvas'
Deleting a branch is permanent. It CANNOT be undone. Continue?
I noticed that the canvas.py example is not working.
I propose a fix for python3. In python3
True
andFalse
are constants and cannot be overridden. Changes have also been made where explicit casting of a real type to an integer is required. Explicit integer arithmetic is now used where appropriate.Hi @ormorph,
the PR seems good, but I can't test here in debian + PTB. It seems there are other issues with where files are installed in debian.
@aneejit1 if you could test and confirm everything is fine with this PR, I will then merge it.
Do not forget that we have to test the examples in both versions of Python.
Hmm, I didn't use incompatible functions. All this math will work in python2 as well. In python2 True and False are variables, but if they were not declared, then their meanings are the same.
Out in Python2.7:
I rechecked all the parameters, now there is a defect to be corrected in View->Enlarge and View->Shrink.
Out:
Now I will transfer it to integer calculations, and in principle it will be possible to merge.
@SlavekB: are you able to run examples in python3 in your system? I tried here and it seems the dist packages for python3 are not installed in the right place (or not installed at all). Haven't spent time on it yet, so just asking aforehead.
Long term, we should drop support for python2 anyway
469316aca3
to4af88a8c9d
2 years agoMade corrections, now there are no warnings. Unfortunately, on python2 I am missing an assembly. If someone can check this in python2, then that would be good.
To build the latest python-tqt, sip4-tqt no longer uses the
<python_site>/sip4_tqt
path, it is now just<python_site>
. The old sip4-tqt build method is no longer working. The build options for the python-tqt package have not changed.At the moment, building with python2 support on Gentoo is quite problematic, so I didn't add this package to the Gentoo overlay earlier.As of version 14.0.13, thanks to the latest changes, it is now possible to add this. A build is currently available for the live branch only.
4af88a8c9d
to223af3b47f
2 years agoAdded latest changes. Now python2.7 is also normally supported. Tested with python2.7 on raspberry pi4. I have version 14.0.12 on my raspberry pi4, I checked it on it.
There is no point in adding ebuilds to the Gentoo overlay, as they are not compatible with the python2 version. For now, I'll wait for the release of version 14.0.13.
I could not find any errors, so I think you can merge.
I can confirm it works fine on python2 in debian.
223af3b47f
into master 2 years ago223af3b47f
.