[IronPython] FIX: Defining classes interactively

Curt Hagenlocher curt at hagenlocher.org
Fri Sep 10 22:18:21 CEST 2004

When using the interactive interpreter to define a class, an
exception is thrown.  The simplest code that reproduces this is

>>> class foo:
...	pass

This results in
System.Reflection.TargetException: Non-static field requires a target.

This problem can be fixed by modifying line 124 in Objects/module.cs
to read "return fi.GetValue(this);" -- that is, changing the 
argument from null to this.

I don't see any negative ramifications to making the change.

Curt Hagenlocher
curt at hagenlocher.org

More information about the Ironpython-users mailing list