From ec81de2519ce364299a11fde495785bef2e9f1d3 2007-03-23 06:09:43 From: fperez Date: 2007-03-23 06:09:43 Subject: [PATCH] Small fix to respect the __file__ attribute when using %run --- diff --git a/IPython/FakeModule.py b/IPython/FakeModule.py index b877dbb..f40da06 100644 --- a/IPython/FakeModule.py +++ b/IPython/FakeModule.py @@ -5,7 +5,7 @@ Class which mimics a module. Needed to allow pickle to correctly resolve namespaces during IPython sessions. -$Id: FakeModule.py 1625 2006-08-12 10:34:44Z vivainio $""" +$Id: FakeModule.py 2169 2007-03-23 06:09:43Z fperez $""" #***************************************************************************** # Copyright (C) 2002-2004 Fernando Perez. @@ -36,7 +36,7 @@ class FakeModule: self.__dict__ = adict # modules should have a __file__ attribute - adict['__file__'] = __file__ + adict.setdefault('__file__',__file__) def __getattr__(self,key): try: diff --git a/doc/ChangeLog b/doc/ChangeLog index 6b44b58..1b2bed6 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2007-03-23 Fernando Perez + + * IPython/FakeModule.py (FakeModule.__init__): Small fix to + respect the __file__ attribute when using %run. Thanks to a bug + report by Sebastian Rooks . + 2007-03-22 Fernando Perez * IPython/iplib.py (raw_input): Fix mishandling of unicode at