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.