Show More
@@ -3,6 +3,8 b'' | |||
|
3 | 3 | Color schemes for exception handling code in IPython. |
|
4 | 4 | """ |
|
5 | 5 | |
|
6 | import warnings | |
|
7 | ||
|
6 | 8 | #***************************************************************************** |
|
7 | 9 | # Copyright (C) 2005-2006 Fernando Perez <fperez@colorado.edu> |
|
8 | 10 | # |
@@ -127,9 +129,19 b' def exception_colors():' | |||
|
127 | 129 | |
|
128 | 130 | return ex_colors |
|
129 | 131 | |
|
132 | class Deprec(object): | |
|
133 | ||
|
134 | def __init__(self, wrapped_obj): | |
|
135 | self.wrapped=wrapped_obj | |
|
136 | ||
|
137 | def __getattr__(self, name): | |
|
138 | val = getattr(self.wrapped, name) | |
|
139 | warnings.warn("Using ExceptionColors global is deprecated", DeprecationWarning) | |
|
140 | # using getattr after warnings break ipydoctest in weird way for 3.5 | |
|
141 | return val | |
|
130 | 142 | |
|
131 | 143 | # For backwards compatibility, keep around a single global object. Note that |
|
132 | 144 | # this should NOT be used, the factory function should be used instead, since |
|
133 | 145 | # these objects are stateful and it's very easy to get strange bugs if any code |
|
134 | 146 | # modifies the module-level object's state. |
|
135 | ExceptionColors = exception_colors() | |
|
147 | ExceptionColors = Deprec(exception_colors()) |
@@ -128,7 +128,7 b' class DocTestFinder(doctest.DocTestFinder):' | |||
|
128 | 128 | Find tests for the given object and any contained objects, and |
|
129 | 129 | add them to `tests`. |
|
130 | 130 | """ |
|
131 |
|
|
|
131 | print('_find for:', obj, name, module) # dbg | |
|
132 | 132 | if hasattr(obj,"skip_doctest"): |
|
133 | 133 | #print 'SKIPPING DOCTEST FOR:',obj # dbg |
|
134 | 134 | obj = DocTestSkip(obj) |
General Comments 0
You need to be logged in to leave comments.
Login now