Initial support for 3.12. Keep compatible with 3.10.
Check function existence instead of shell version.
Fix an issue that launching the preference dialog doesn't work in 3.12.
Avoid breaking 3.10.
Merge pull request #242 from stoolye/master

Initial support for 3.12. Keep compatible with 3.10.