Correctly workaround bug when detect platform and run on jython