Skip to content

Commit d5d637e

Browse files
committed
ultraTB.py => core/ultratb.py and imports updated.
1 parent 40f9440 commit d5d637e

14 files changed

Lines changed: 67 additions & 46 deletions

File tree

IPython/config/configloader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import os
1414
from pprint import pprint
1515

16-
from IPython import ultraTB
16+
from IPython.core import ultratb
1717
from IPython.utils.ipstruct import Struct
1818
from IPython.utils.genutils import *
1919

@@ -68,7 +68,7 @@ def load(self,fname,convert=None,recurse_key='',incpath = '.',**kw):
6868
# avoid including the same file more than once
6969
if fname in self.included:
7070
return data
71-
Xinfo = ultraTB.AutoFormattedTB(color_scheme='NoColor')
71+
Xinfo = ultratb.AutoFormattedTB(color_scheme='NoColor')
7272
if convert==None and recurse_key : convert = {qwflat:recurse_key}
7373
# for production, change warn to 0:
7474
data.merge(read_dict(fname,convert,fs=self.field_sep,strip=1,

IPython/core/completer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ def uniq(alist):
632632
except IndexError:
633633
return None
634634
except:
635-
#from IPython.ultraTB import AutoFormattedTB; # dbg
635+
#from IPython.core.ultratb import AutoFormattedTB; # dbg
636636
#tb=AutoFormattedTB('Verbose');tb() #dbg
637637

638638
# If completion fails, don't annoy the user.

IPython/core/crashhandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
# Our own
2727
from IPython.core import release
28-
from IPython import ultraTB
28+
from IPython.core import ultratb
2929
from IPython.external.Itpl import itpl
3030

3131
from IPython.utils.genutils import *
@@ -133,7 +133,7 @@ def __call__(self,etype, evalue, etb):
133133
# write the report filename into the instance dict so it can get
134134
# properly expanded out in the user message template
135135
self.crash_report_fname = report_name
136-
TBhandler = ultraTB.VerboseTB(color_scheme=color_scheme,
136+
TBhandler = ultratb.VerboseTB(color_scheme=color_scheme,
137137
long_header=1)
138138
traceback = TBhandler.text(etype,evalue,etb,context=31)
139139

IPython/core/iplib.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
# IPython's own modules
4747
#import IPython
48-
from IPython import ultraTB
48+
from IPython.core import ultratb
4949
from IPython.utils import PyColorize
5050
from IPython.core import debugger, oinspect
5151
from IPython.Extensions import pickleshare
@@ -57,7 +57,7 @@
5757
from IPython.utils.ipstruct import Struct
5858
from IPython.lib.backgroundjobs import BackgroundJobManager
5959
from IPython.utils.genutils import *
60-
from IPython.strdispatch import StrDispatch
60+
from IPython.utils.strdispatch import StrDispatch
6161
from IPython.core import ipapi
6262
import IPython.core.history
6363
import IPython.core.prefilter as prefilter
@@ -340,16 +340,16 @@ class InputList(list):
340340
def __getslice__(self,i,j):
341341
return ''.join(list.__getslice__(self,i,j))
342342

343-
class SyntaxTB(ultraTB.ListTB):
343+
class SyntaxTB(ultratb.ListTB):
344344
"""Extension which holds some state: the last exception value"""
345345

346346
def __init__(self,color_scheme = 'NoColor'):
347-
ultraTB.ListTB.__init__(self,color_scheme)
347+
ultratb.ListTB.__init__(self,color_scheme)
348348
self.last_syntax_error = None
349349

350350
def __call__(self, etype, value, elist):
351351
self.last_syntax_error = value
352-
ultraTB.ListTB.__call__(self,etype,value,elist)
352+
ultratb.ListTB.__call__(self,etype,value,elist)
353353

354354
def clear_err_state(self):
355355
"""Return the current error state and clear it"""
@@ -714,7 +714,7 @@ def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
714714
# The interactive one is initialized with an offset, meaning we always
715715
# want to remove the topmost item in the traceback, which is our own
716716
# internal code. Valid modes: ['Plain','Context','Verbose']
717-
self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
717+
self.InteractiveTB = ultratb.AutoFormattedTB(mode = 'Plain',
718718
color_scheme='NoColor',
719719
tb_offset = 1)
720720

@@ -725,7 +725,7 @@ def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
725725
# thread (such as in GUI code) propagate directly to sys.excepthook,
726726
# and there's no point in printing crash dumps for every user exception.
727727
if self.isthreaded:
728-
ipCrashHandler = ultraTB.FormattedTB()
728+
ipCrashHandler = ultratb.FormattedTB()
729729
else:
730730
from IPython.core import crashhandler
731731
ipCrashHandler = crashhandler.IPythonCrashHandler(self)

IPython/core/ipmaker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
106106

107107
if DEVDEBUG:
108108
# For developer debugging only (global flag)
109-
from IPython import ultraTB
110-
sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
109+
from IPython.core import ultratb
110+
sys.excepthook = ultratb.VerboseTB(call_pdb=1)
111111

112112
IP.BANNER_PARTS = ['Python %s\n'
113113
'Type "copyright", "credits" or "license" '

IPython/core/shell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# IPython imports
3636
import IPython
37-
from IPython import ultraTB
37+
from IPython.core import ultratb
3838
from IPython.core import ipapi
3939
from IPython.core.magic import Magic
4040
from IPython.utils.genutils import Term,warn,error,flag_calls, ask_yes_no
@@ -178,7 +178,7 @@ def __init__(self,argv=None,banner='',exit_msg=None,rc_override=None,
178178
sys.displayhook = self.sys_displayhook_ori
179179
# don't use the ipython crash handler so that user exceptions aren't
180180
# trapped
181-
sys.excepthook = ultraTB.FormattedTB(color_scheme = self.IP.rc.colors,
181+
sys.excepthook = ultratb.FormattedTB(color_scheme = self.IP.rc.colors,
182182
mode = self.IP.rc.xmode,
183183
call_pdb = self.IP.rc.pdb)
184184
self.restore_system_completer()

IPython/core/tests/test_imports.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ def test_import_shell():
6363

6464
def test_import_shellglobals():
6565
from IPython.core import shellglobals
66+
67+
def test_import_ultratb():
68+
from IPython.core import ultratb
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
ultraTB.py -- Spice up your tracebacks!
3+
ultratb.py -- Spice up your tracebacks!
44
55
* ColorTB
66
I've always found it a bit hard to visually parse tracebacks in Python. The
@@ -9,8 +9,8 @@
99
text editor.
1010
1111
Installation instructions for ColorTB:
12-
import sys,ultraTB
13-
sys.excepthook = ultraTB.ColorTB()
12+
import sys,ultratb
13+
sys.excepthook = ultratb.ColorTB()
1414
1515
* VerboseTB
1616
I've also included a port of Ka-Ping Yee's "cgitb.py" that produces all kinds
@@ -37,8 +37,8 @@
3737
3838
3939
Installation instructions for ColorTB:
40-
import sys,ultraTB
41-
sys.excepthook = ultraTB.VerboseTB()
40+
import sys,ultratb
41+
sys.excepthook = ultratb.VerboseTB()
4242
4343
Note: Much of the code in this module was lifted verbatim from the standard
4444
library module 'traceback.py' and Ka-Ping Yee's 'cgitb.py'.
@@ -103,7 +103,7 @@
103103
# Default color scheme. This is used, for example, by the traceback
104104
# formatter. When running in an actual IPython instance, the user's rc.colors
105105
# value is used, but havinga module global makes this functionality available
106-
# to users of ultraTB who are NOT running inside ipython.
106+
# to users of ultratb who are NOT running inside ipython.
107107
DEFAULT_SCHEME = 'NoColor'
108108

109109
#---------------------------------------------------------------------------

IPython/lib/backgroundjobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import sys
3131
import threading
3232

33-
from IPython.ultraTB import AutoFormattedTB
33+
from IPython.core.ultratb import AutoFormattedTB
3434
from IPython.utils.genutils import warn,error
3535

3636
class BackgroundJobManager:

IPython/testing/iptest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def make_runners():
207207
'outputtrap.py', 'platutils.py', 'prefilter.py', 'prompts.py',
208208
'PyColorize.py', 'release.py', 'rlineimpl.py', 'shadowns.py',
209209
'shellglobals.py', 'strdispatch.py', 'twshell.py',
210-
'ultraTB.py', 'upgrade_dir.py', 'usage.py', 'wildcard.py',
210+
'ultratb.py', 'upgrade_dir.py', 'usage.py', 'wildcard.py',
211211
# See note above for why this is skipped
212212
# 'shell.py',
213213
'winconsole.py']

0 commit comments

Comments
 (0)