##// END OF EJS Templates
Added additional logic to InteractiveShell.instance()....
Brian Granger -
Show More
@@ -268,6 +268,14 b' class InteractiveShell(Configurable, Magic):'
268 """Returns a global InteractiveShell instance."""
268 """Returns a global InteractiveShell instance."""
269 if not hasattr(cls, "_instance"):
269 if not hasattr(cls, "_instance"):
270 cls._instance = cls(*args, **kwargs)
270 cls._instance = cls(*args, **kwargs)
271 print cls
272 print cls._instance
273 # Now make sure that the instance will also be returned by
274 # the subclasses instance attribute.
275 for subclass in cls.mro():
276 if issubclass(subclass, InteractiveShell):
277 print subclass
278 subclass._instance = cls._instance
271 return cls._instance
279 return cls._instance
272
280
273 @classmethod
281 @classmethod
General Comments 0
You need to be logged in to leave comments. Login now