Having sys.platform == "cli" is one of those things which just causes a bunch of compatibility issues in IronPython 2.7. For IronPython 3 we should consider changing it to a standard value. There are other mechanisms such as platform.python_implementation() == "IronPython" which can be used to figure out if we're running on IronPython or not.
Note that there's also sys.implementation since Python 3.3 which we could use so we don't have to import platform to do checks in the std lib.
Having
sys.platform == "cli"is one of those things which just causes a bunch of compatibility issues in IronPython 2.7. For IronPython 3 we should consider changing it to a standard value. There are other mechanisms such asplatform.python_implementation() == "IronPython"which can be used to figure out if we're running on IronPython or not.Note that there's also
sys.implementationsince Python 3.3 which we could use so we don't have toimport platformto do checks in the std lib.