From 83eeb25dd2203158d9753dbcd5f07481c88fa1e2 2014-12-12 23:57:17
From: Jason Grout <jgrout6@bloomberg.net>
Date: 2014-12-12 23:57:17
Subject: [PATCH] Change IPython widget warning to get rid of filenames and line numbers

We do this to not confuse the interactive user

---

diff --git a/IPython/html/widgets/__init__.py b/IPython/html/widgets/__init__.py
index 9480d95..138fdb4 100644
--- a/IPython/html/widgets/__init__.py
+++ b/IPython/html/widgets/__init__.py
@@ -24,6 +24,9 @@ from .widget_selection import RadioButtonsWidget, ToggleButtonsWidget, DropdownW
 from .widget_selectioncontainer import TabWidget, AccordionWidget
 from .widget_string import HTMLWidget, LatexWidget, TextWidget, TextareaWidget
 
-# Warn on import
-from warnings import warn
-warn("IPython widgets are experimental and may change in the future.", FutureWarning, stacklevel=2)
+# we use warn_explicit so we have very brief messages without file or line numbers
+# the concern is that file or line numbers will confuse the interactive user
+from warnings import warn_explicit
+__warningregistry__ = {}
+warn_explicit("IPython widgets are experimental and may change in the future.",
+              FutureWarning, '', 0, registry=__warningregistry__)