GNOME Bugzilla – Bug 682320
Replace usage of __import__ with importlib.import_module
Last modified: 2013-07-18 22:05:19 UTC
The python developers are recommending to do this as seen in this discussion: http://bugs.python.org/issue15715 In regards to python versions, does pygobject support anything pre 2.7? It would be great to have some kind of official note on the wiki about this because supporting pre 2.7 does make working on this stuff more difficult. It may even help to give a build error for pre-2.7 versions of python (or whatever version support stops at) if this is the case.
configure.ac says m4_define(python_min_ver, 2.5.2) m4_define(python3_min_ver, 3.1) which I consider the authoritative source. We are in API/feature freeze for GNOME 3.6 since yesterday, so these should not be raised until we start the pygobject 3.5 series. The currently frozen Debian release still supports 2.6 (will be dropped in the next release), Ubuntu only supports 2.7, I'm not sure about Fedora but as they are usually living on the edge I guess they only support 2.7 as well. So I think for pygobject's 3.5 series for GNOME 3.8 it's fine to bump to >= 2.7. If you want to fix it before, we could do a sys.version_info check, but that's a bit ugly of course.
Thanks for the info. I'm don't think adding a version check would be worthwhile if __import__ still works. Doing a full and clean replace targeting pygobject 3.5 seems right.
PyGObject 3.4 supports 2.6 and newer. FWIW, I wouldn't mind if 3.7.x dropped 2.6 support and only supports 2.7 and 3.x, as 2.7 has been out for ages now.
For the record, git master (3.9.x) supports only Python 2.7 now, so this is unblocked.
The following fix has been pushed: 9042710 Replace usage of __import__ with importlib.import_module
Created attachment 249573 [details] [review] Replace usage of __import__ with importlib.import_module