diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index 3ddd9bb..02af20e 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -355,3 +355,10 @@ def test_cpaste(): for code in tests['fail']: check_cpaste(code, should_fail=True) + +def test_xmode(): + # Calling xmode three times should be a no-op + xmode = _ip.InteractiveTB.mode + for i in range(3): + _ip.magic("xmode") + nt.assert_equal(_ip.InteractiveTB.mode, xmode) diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index b40aaa5..85200a1 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -1090,7 +1090,7 @@ class FormattedTB(VerboseTB, ListTB): # include variable details only in 'Verbose' mode self.include_vars = (self.mode == self.valid_modes[2]) # Set the join character for generating text tracebacks - self.tb_join_char = self._join_chars[mode] + self.tb_join_char = self._join_chars[self.mode] # some convenient shorcuts def plain(self):