diff --git a/IPython/core/displayhook.py b/IPython/core/displayhook.py index 9890b3d..4949893 100644 --- 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 index c45d717..2f0ebe2 100644 --- 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)