I need to write a module which will be used from both CPython and IronPython. What's the best way to detect IronPython, since I need a slightly different behaviour in that case?
I noticed that sys.platform is "win32" on CPython, but "cli" on IronPython.
Is there another preferred/standard way of detecting it?
The "cli" (= Common Language Infrastructure = .NET = IronPython) is probably reliable.
As far as I know, you can access .NET libraries within IronPython, so you could try importing a .NET library, and catch the exception it throws when .NET is not available (as in CPython).
Best way to detect IronPython