Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add Python 3.9 compatibility. #204
Conversation
|
I am not sure the build failures in some of the pipelines are related to my PR. |
| @@ -180,8 +181,12 @@ def _get_custom_widgets(ui_file): | |||
| return {} | |||
|
|
|||
| custom_widget_classes = {} | |||
| if PY33: | |||
goanpeca
Mar 12, 2020
•
Member
We are not supporting this version of python, so why do we need this?
Or is the extra 3 a type?
We are not supporting this version of python, so why do we need this?
Or is the extra 3 a type?
tirkarthi
Oct 27, 2020
Author
Sorry for the late reply. PY33 is a variable to ensure the python version is 3.3 and above. As per the below deprecation it seems the methods were deprecated from 3.2. So I made sure to use list(custom_widgets) in Python 3.3+ and fallback to getchildren for versions below python 3.3 . Python 3.3 is listed in setup.py and this is the format used in most places for compatibility and hence my change.
Methods getchildren() and getiterator() of classes ElementTree and Element in the ElementTree module have been removed. They were deprecated in Python 3.2. Use iter(x) or list(x) instead of x.getchildren() and x.iter() or list(x.iter()) instead of x.getiterator(). (Contributed by Serhiy Storchaka in bpo-36543.)
Sorry for the late reply. PY33 is a variable to ensure the python version is 3.3 and above. As per the below deprecation it seems the methods were deprecated from 3.2. So I made sure to use list(custom_widgets) in Python 3.3+ and fallback to getchildren for versions below python 3.3 . Python 3.3 is listed in setup.py and this is the format used in most places for compatibility and hence my change.
Methods getchildren() and getiterator() of classes ElementTree and Element in the ElementTree module have been removed. They were deprecated in Python 3.2. Use iter(x) or list(x) instead of x.getchildren() and x.iter() or list(x.iter()) instead of x.getiterator(). (Contributed by Serhiy Storchaka in bpo-36543.)
|
@goanpeca it might be nicer to use it seems that it would be more idiomatic to use |
ImportErrorin Python 3.9 and raisesDeprecationWarningfrom 3.4 . Hence usecollections.abcand also preserve compatibility with Python 2. Ref : python/cpython#10596listinstead of deprecated getchildren in Python 3. Fixes #206