Share via


Mdbg IronPython Extension updated for Beta 1

You probably heard that Iron Python Beta 1 was released.  It has a small (but very worthy) breaking change, and I've updated the MDbg-IronPython extension accordingly.

I updated it previously for 0.9.3. The changes are related to redirecting the python console. Here is the progression:

        // Hook input + output. This is redirecting pythons 'sys.stdout, sys.stdin, sys.stderr'
        // This connects python's sys.stdout --> Stream --> Mdbg console.
        Stream s = new MyStream();

#if false
        // This is for versions before .0.9.3
// IronPython.Modules.sys.stdin =
// IronPython.Modules.sys.stderr =
// IronPython.Modules.sys.stdout = new IronPython.Objects.PythonFile(s, "w", false);
#elif false
        // 0.9.3. breaks the above line because it adds a "name" string parameter. Here's what it should be in 0.9.3:
//IronPython.Objects.Ops.sys.stdin = new IronPython.Objects.PythonFile(s, "stdin", "r", false);
//IronPython.Objects.Ops.sys.stderr = new IronPython.Objects.PythonFile(s, "stderr", "w", false);
//IronPython.Objects.Ops.sys.stdout = new IronPython.Objects.PythonFile(s, "stdout", "w", false);
#else       
        // Beta 1 breaks the above again. IMO, this integrates into .NET much cleaner:
        m_python.SetStderr(s);
m_python.SetStdin(s);
m_python.SetStdout(s);
#endif

I think the current plan of directly passing .NET Stream objects in is a much cleaner way to integrate into .NET.

Comments