From 6703c8c63924163543eab38f66178ef53d1690c4 2012-09-28 20:41:09 From: Pawel Jasinski Date: 2012-09-28 20:41:09 Subject: [PATCH] changes for ironpython --- diff --git a/IPython/core/displayhook.py b/IPython/core/displayhook.py old mode 100644 new mode 100755 index 9890b3d..4949893 --- a/IPython/core/displayhook.py +++ b/IPython/core/displayhook.py @@ -25,6 +25,9 @@ from __future__ import print_function import __builtin__ +import sys + + from IPython.config.configurable import Configurable from IPython.utils import io from IPython.utils.traitlets import Instance, List @@ -266,5 +269,7 @@ class DisplayHook(Configurable): self.shell.user_ns.update({'_':None,'__':None, '___':None}) import gc # TODO: Is this really needed? - gc.collect() + # IronPython blocks here forever + if sys.platform != "cli": + gc.collect() diff --git a/IPython/utils/traitlets.py b/IPython/utils/traitlets.py old mode 100644 new mode 100755 index c45d717..2f0ebe2 --- a/IPython/utils/traitlets.py +++ b/IPython/utils/traitlets.py @@ -927,11 +927,15 @@ else: def validate(self, obj, value): if isinstance(value, int): return value - elif isinstance(value, long): + if isinstance(value, long): # downcast longs that fit in int: # note that int(n > sys.maxint) returns a long, so # we don't need a condition on this cast return int(value) + if sys.platform == "cli": + from System import Int64 + if isinstance(value, Int64): + return int(value) self.error(obj, value)