This is a multi-part message in MIME format. --------------EA0D50E02DA38B730060AB92 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I am trying to fix the duplicate argument bug in the compiler. [example] >>> def f(a,a): print a ... >>> f(1,2) 2 [/example] My problem is that I get a segfault whenever I try to raise an com_error from com_arglist. I have attached a very short patch. Thanks for any hint, Peter P.S.: Is this on topic for python-dev? If not, where should I send such a request? -- Peter Schneider-Kamp ++47-7388-7331 Herman Krags veg 51-11 mailto:peter@schneider-kamp.de N-7050 Trondheim http://schneider-kamp.de --------------EA0D50E02DA38B730060AB92 Content-Type: text/plain; charset=us-ascii; name="compile_funcdef.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="compile_funcdef.patch" diff -c -d -T --recursive python/dist/src/Python/compile.c python-mod/dist/src/Python/compile.c *** python/dist/src/Python/compile.c Mon Jul 3 21:39:47 2000 --- python-mod/dist/src/Python/compile.c Sat Jul 8 19:13:42 2000 *************** *** 3102,3109 **** name = nbuf; sprintf(nbuf, ".%d", i); complex = 1; } ! com_newlocal(c, name); c->c_argcount++; if (++i >= nch) break; --- 3103,3120 ---- name = nbuf; sprintf(nbuf, ".%d", i); complex = 1; + } + + nameval = PyString_InternFromString(name); + if (nameval == NULL) { + c->c_errors++; } ! if (PyDict_GetItem(c->c_locals, nameval)) { ! com_error(c, PyExc_SyntaxError,"double identifier in function definition"); ! } ! com_newlocal_o(c, nameval); ! Py_DECREF(nameval); ! c->c_argcount++; if (++i >= nch) break; --------------EA0D50E02DA38B730060AB92--
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4