Message281169
Android slowly becomes a first-citizen class platform in CPython thanks to Xavier de Gaye and other motivated developers, thanks to all of them :-)
To fix the issue #28596, we need a function to check if we are running Android. Chi Hsuan Yen proposed to use sysconfig to get the new ANDROID_API_LEVEL configuration option:
+ if sysconfig.get_config_var('ANDROID_API_LEVEL'):
But I asked to avoid sysconfig to reduce imports at Python startup (especially when the site module is not loaded). I proposed to add a new function to the sys module: sys.getandroidapilevel().
sys.getandroidapilevel() would only be available on Android, as sys.getwindowsversion() is only available on Windows, and would return ANDROID_API_LEVEL as an integer.
I'm not sure about the type: should we use a string? A tuple of integers like sys.version_info?
sys.getwindowsversion() returns a named tuple:
https://docs.python.org/dev/library/sys.html#sys.getwindowsversion
I'm sorry, I don't have access to an Android development platform, so I let someone else implement it :-) |
|
Date |
User |
Action |
Args |
2016-11-18 21:26:35 | vstinner | set | recipients:
+ vstinner, xdegaye, yan12125 |
2016-11-18 21:26:35 | vstinner | set | messageid: <1479504395.69.0.761590307394.issue28740@psf.upfronthosting.co.za> |
2016-11-18 21:26:35 | vstinner | link | issue28740 messages |
2016-11-18 21:26:35 | vstinner | create | |
|