Mercurial > cpython-lru_cache-weakref
annotate Python/traceback.c @ 3294:2bddfb3cfcf1 legacy-trunk
don't return from main loop when error occurs
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sun, 10 Dec 1995 04:57:42 +0000 |
| parents | d249111d4ccc |
| children | 65d2d8e67da3 |
| rev | line source |
|---|---|
| 145 | 1 /*********************************************************** |
|
2062
d0d0a69b5ca3
Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
2052
diff
changeset
|
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
|
d0d0a69b5ca3
Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
2052
diff
changeset
|
3 The Netherlands. |
| 145 | 4 |
| 5 All Rights Reserved | |
| 6 | |
| 7 Permission to use, copy, modify, and distribute this software and its | |
| 8 documentation for any purpose and without fee is hereby granted, | |
| 9 provided that the above copyright notice appear in all copies and that | |
| 10 both that copyright notice and this permission notice appear in | |
| 11 supporting documentation, and that the names of Stichting Mathematisch | |
| 12 Centrum or CWI not be used in advertising or publicity pertaining to | |
| 13 distribution of the software without specific, written prior permission. | |
| 14 | |
| 15 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO | |
| 16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
| 17 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE | |
| 18 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
| 19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
| 20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
| 21 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| 22 | |
| 23 ******************************************************************/ | |
| 24 | |
| 86 | 25 /* Traceback implementation */ |
| 26 | |
| 27 #include "allobjects.h" | |
| 28 | |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
29 #include "sysmodule.h" |
| 86 | 30 #include "compile.h" |
| 31 #include "frameobject.h" | |
| 32 #include "traceback.h" | |
| 33 #include "structmember.h" | |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
34 #include "osdefs.h" |
| 86 | 35 |
| 36 typedef struct _tracebackobject { | |
| 37 OB_HEAD | |
| 38 struct _tracebackobject *tb_next; | |
| 39 frameobject *tb_frame; | |
| 40 int tb_lasti; | |
| 41 int tb_lineno; | |
| 42 } tracebackobject; | |
| 43 | |
| 44 #define OFF(x) offsetof(tracebackobject, x) | |
| 45 | |
| 46 static struct memberlist tb_memberlist[] = { | |
| 47 {"tb_next", T_OBJECT, OFF(tb_next)}, | |
| 48 {"tb_frame", T_OBJECT, OFF(tb_frame)}, | |
| 49 {"tb_lasti", T_INT, OFF(tb_lasti)}, | |
| 50 {"tb_lineno", T_INT, OFF(tb_lineno)}, | |
| 51 {NULL} /* Sentinel */ | |
| 52 }; | |
| 53 | |
| 54 static object * | |
| 55 tb_getattr(tb, name) | |
| 56 tracebackobject *tb; | |
| 57 char *name; | |
| 58 { | |
| 59 return getmember((char *)tb, tb_memberlist, name); | |
| 60 } | |
| 61 | |
| 62 static void | |
| 63 tb_dealloc(tb) | |
| 64 tracebackobject *tb; | |
| 65 { | |
| 66 XDECREF(tb->tb_next); | |
| 67 XDECREF(tb->tb_frame); | |
| 68 DEL(tb); | |
| 69 } | |
| 70 | |
|
3099
d249111d4ccc
spell TraceBack with capital B
Guido van Rossum <guido@python.org>
parents:
2844
diff
changeset
|
71 #define Tracebacktype PyTraceBack_Type |
|
d249111d4ccc
spell TraceBack with capital B
Guido van Rossum <guido@python.org>
parents:
2844
diff
changeset
|
72 #define is_tracebackobject PyTraceBack_Check |
|
2844
0261bf5b3819
keyword arguments and faster calls
Guido van Rossum <guido@python.org>
parents:
2811
diff
changeset
|
73 |
|
0261bf5b3819
keyword arguments and faster calls
Guido van Rossum <guido@python.org>
parents:
2811
diff
changeset
|
74 typeobject Tracebacktype = { |
| 86 | 75 OB_HEAD_INIT(&Typetype) |
| 76 0, | |
| 77 "traceback", | |
| 78 sizeof(tracebackobject), | |
| 79 0, | |
|
1831
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
80 (destructor)tb_dealloc, /*tp_dealloc*/ |
| 86 | 81 0, /*tp_print*/ |
|
1831
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
82 (getattrfunc)tb_getattr, /*tp_getattr*/ |
| 86 | 83 0, /*tp_setattr*/ |
| 84 0, /*tp_compare*/ | |
| 85 0, /*tp_repr*/ | |
| 86 0, /*tp_as_number*/ | |
| 87 0, /*tp_as_sequence*/ | |
| 88 0, /*tp_as_mapping*/ | |
| 89 }; | |
| 90 | |
| 91 static tracebackobject * | |
| 92 newtracebackobject(next, frame, lasti, lineno) | |
| 93 tracebackobject *next; | |
| 94 frameobject *frame; | |
| 95 int lasti, lineno; | |
| 96 { | |
| 97 tracebackobject *tb; | |
| 98 if ((next != NULL && !is_tracebackobject(next)) || | |
| 99 frame == NULL || !is_frameobject(frame)) { | |
| 100 err_badcall(); | |
| 101 return NULL; | |
| 102 } | |
| 103 tb = NEWOBJ(tracebackobject, &Tracebacktype); | |
| 104 if (tb != NULL) { | |
| 105 XINCREF(next); | |
| 106 tb->tb_next = next; | |
| 107 XINCREF(frame); | |
| 108 tb->tb_frame = frame; | |
| 109 tb->tb_lasti = lasti; | |
| 110 tb->tb_lineno = lineno; | |
| 111 } | |
| 112 return tb; | |
| 113 } | |
| 114 | |
| 115 static tracebackobject *tb_current = NULL; | |
| 116 | |
| 117 int | |
|
597
800cf4086fb3
tb_here() can now get the lasti and lineno arguments from the frame.
Guido van Rossum <guido@python.org>
parents:
291
diff
changeset
|
118 tb_here(frame) |
| 86 | 119 frameobject *frame; |
| 120 { | |
| 121 tracebackobject *tb; | |
|
597
800cf4086fb3
tb_here() can now get the lasti and lineno arguments from the frame.
Guido van Rossum <guido@python.org>
parents:
291
diff
changeset
|
122 tb = newtracebackobject(tb_current, frame, frame->f_lasti, frame->f_lineno); |
| 86 | 123 if (tb == NULL) |
| 124 return -1; | |
| 125 XDECREF(tb_current); | |
| 126 tb_current = tb; | |
| 127 return 0; | |
| 128 } | |
| 129 | |
| 130 object * | |
| 131 tb_fetch() | |
| 132 { | |
| 133 object *v; | |
| 134 v = (object *)tb_current; | |
| 135 tb_current = NULL; | |
| 136 return v; | |
| 137 } | |
| 138 | |
| 139 int | |
| 140 tb_store(v) | |
| 141 object *v; | |
| 142 { | |
| 143 if (v != NULL && !is_tracebackobject(v)) { | |
| 144 err_badcall(); | |
| 145 return -1; | |
| 146 } | |
| 147 XDECREF(tb_current); | |
| 148 XINCREF(v); | |
| 149 tb_current = (tracebackobject *)v; | |
| 150 return 0; | |
| 151 } | |
| 152 | |
| 153 static void | |
|
1831
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
154 tb_displayline(f, filename, lineno, name) |
|
1073
2c0432fcc270
Modified most (but not yet all) I/O to always go through sys.stdout or
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
155 object *f; |
| 86 | 156 char *filename; |
| 157 int lineno; | |
|
1831
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
158 char *name; |
| 86 | 159 { |
| 160 FILE *xfp; | |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
161 char linebuf[1000]; |
| 86 | 162 int i; |
|
1831
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
163 #ifdef MPW |
|
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
164 /* This is needed by MPW's File and Line commands */ |
|
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
165 #define FMT " File \"%.900s\"; line %d # in %s\n" |
|
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
166 #else |
|
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
167 /* This is needed by Emacs' compile command */ |
|
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
168 #define FMT " File \"%.900s\", line %d, in %s\n" |
|
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
169 #endif |
| 86 | 170 xfp = fopen(filename, "r"); |
| 171 if (xfp == NULL) { | |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
172 /* Search tail of filename in sys.path before giving up */ |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
173 object *path; |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
174 char *tail = strrchr(filename, SEP); |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
175 if (tail == NULL) |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
176 tail = filename; |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
177 else |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
178 tail++; |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
179 path = sysget("path"); |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
180 if (path != NULL && is_listobject(path)) { |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
181 int npath = getlistsize(path); |
|
1909
0c232194a64f
* Python/traceback.c: security fix -- check for buffer oveflow
Guido van Rossum <guido@python.org>
parents:
1831
diff
changeset
|
182 int taillen = strlen(tail); |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
183 char namebuf[MAXPATHLEN+1]; |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
184 for (i = 0; i < npath; i++) { |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
185 object *v = getlistitem(path, i); |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
186 if (is_stringobject(v)) { |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
187 int len; |
|
1909
0c232194a64f
* Python/traceback.c: security fix -- check for buffer oveflow
Guido van Rossum <guido@python.org>
parents:
1831
diff
changeset
|
188 len = getstringsize(v); |
|
0c232194a64f
* Python/traceback.c: security fix -- check for buffer oveflow
Guido van Rossum <guido@python.org>
parents:
1831
diff
changeset
|
189 if (len + 1 + taillen >= MAXPATHLEN) |
|
0c232194a64f
* Python/traceback.c: security fix -- check for buffer oveflow
Guido van Rossum <guido@python.org>
parents:
1831
diff
changeset
|
190 continue; /* Too long */ |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
191 strcpy(namebuf, getstringvalue(v)); |
|
1909
0c232194a64f
* Python/traceback.c: security fix -- check for buffer oveflow
Guido van Rossum <guido@python.org>
parents:
1831
diff
changeset
|
192 if (strlen(namebuf) != len) |
|
0c232194a64f
* Python/traceback.c: security fix -- check for buffer oveflow
Guido van Rossum <guido@python.org>
parents:
1831
diff
changeset
|
193 continue; /* v contains '\0' */ |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
194 if (len > 0 && namebuf[len-1] != SEP) |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
195 namebuf[len++] = SEP; |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
196 strcpy(namebuf+len, tail); |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
197 xfp = fopen(namebuf, "r"); |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
198 if (xfp != NULL) { |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
199 filename = namebuf; |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
200 break; |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
201 } |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
202 } |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
203 } |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
204 } |
| 86 | 205 } |
|
1831
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
206 sprintf(linebuf, FMT, filename, lineno, name); |
|
1073
2c0432fcc270
Modified most (but not yet all) I/O to always go through sys.stdout or
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
207 writestring(linebuf, f); |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
208 if (xfp == NULL) |
|
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
209 return; |
| 86 | 210 for (i = 0; i < lineno; i++) { |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
211 if (fgets(linebuf, sizeof linebuf, xfp) == NULL) |
| 86 | 212 break; |
| 213 } | |
| 214 if (i == lineno) { | |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
215 char *p = linebuf; |
|
2811
07fc4fefb683
ignore control-l (parallelling change to tokenizer.c)
Guido van Rossum <guido@python.org>
parents:
2062
diff
changeset
|
216 while (*p == ' ' || *p == '\t' || *p == '\014') |
| 86 | 217 p++; |
|
1073
2c0432fcc270
Modified most (but not yet all) I/O to always go through sys.stdout or
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
218 writestring(" ", f); |
|
2c0432fcc270
Modified most (but not yet all) I/O to always go through sys.stdout or
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
219 writestring(p, f); |
| 86 | 220 if (strchr(p, '\n') == NULL) |
|
1073
2c0432fcc270
Modified most (but not yet all) I/O to always go through sys.stdout or
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
221 writestring("\n", f); |
| 86 | 222 } |
| 223 fclose(xfp); | |
| 224 } | |
| 225 | |
| 226 static void | |
|
1425
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
227 tb_printinternal(tb, f, limit) |
| 86 | 228 tracebackobject *tb; |
|
1073
2c0432fcc270
Modified most (but not yet all) I/O to always go through sys.stdout or
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
229 object *f; |
|
1425
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
230 int limit; |
| 86 | 231 { |
|
1425
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
232 int depth = 0; |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
233 tracebackobject *tb1 = tb; |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
234 while (tb1 != NULL) { |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
235 depth++; |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
236 tb1 = tb1->tb_next; |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
237 } |
|
674
4e2d239dc64c
Move printing of filename and lineno to tb_displayline.
Guido van Rossum <guido@python.org>
parents:
597
diff
changeset
|
238 while (tb != NULL && !intrcheck()) { |
|
1425
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
239 if (depth <= limit) |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
240 tb_displayline(f, |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
241 getstringvalue(tb->tb_frame->f_code->co_filename), |
|
1831
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
242 tb->tb_lineno, |
|
216b755515e6
add function name to traceback info
Guido van Rossum <guido@python.org>
parents:
1425
diff
changeset
|
243 getstringvalue(tb->tb_frame->f_code->co_name)); |
|
1425
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
244 depth--; |
| 86 | 245 tb = tb->tb_next; |
| 246 } | |
| 247 } | |
| 248 | |
| 249 int | |
|
1073
2c0432fcc270
Modified most (but not yet all) I/O to always go through sys.stdout or
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
250 tb_print(v, f) |
| 86 | 251 object *v; |
|
1073
2c0432fcc270
Modified most (but not yet all) I/O to always go through sys.stdout or
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
252 object *f; |
| 86 | 253 { |
|
1425
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
254 object *limitv; |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
255 int limit = 1000; |
| 86 | 256 if (v == NULL) |
| 257 return 0; | |
| 258 if (!is_tracebackobject(v)) { | |
| 259 err_badcall(); | |
| 260 return -1; | |
| 261 } | |
|
1425
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
262 limitv = sysget("tracebacklimit"); |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
263 if (limitv && is_intobject(limitv)) { |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
264 limit = getintvalue(limitv); |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
265 if (limit <= 0) |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
266 return 0; |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
267 } |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
268 writestring("Traceback (innermost last):\n", f); |
|
72bddfad351a
* mpzmodule.c: cast some methods to the proper type.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
269 tb_printinternal((tracebackobject *)v, f, limit); |
| 86 | 270 return 0; |
| 271 } |
