diff --git a/IPython/core/display.py b/IPython/core/display.py index 4d43552..9807e63 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -655,7 +655,8 @@ class JSON(DisplayObject): @data.setter def data(self, data): if isinstance(data, str): - warnings.warn("JSON expects JSONable dict or list, not JSON strings") + if getattr(self, 'filename', None) is None: + warnings.warn("JSON expects JSONable dict or list, not JSON strings") data = json.loads(data) self._data = data @@ -757,6 +758,8 @@ class GeoJSON(DisplayObject): @data.setter def data(self, data): if isinstance(data, str): + if getattr(self, 'filename', None) is None: + warnings.warn("GeoJSON expects JSONable dict or list, not JSON strings") data = json.loads(data) self._data = data