<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Python/pythonrun.c, branch v2.1c2</title>
<subtitle>Python interpreter</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/pythonrun.c?h=v2.1c2</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/pythonrun.c?h=v2.1c2'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2001-03-26T19:53:38Z</updated>
<entry>
<title>Bug fix: compile() called from a nested-scopes-enable Python was not</title>
<updated>2001-03-26T19:53:38Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2001-03-26T19:53:38Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=673a4fda5133554b48cbe06edb416386ca301501'/>
<id>urn:sha1:673a4fda5133554b48cbe06edb416386ca301501</id>
<content type='text'>
using nested scopes to compile its argument.  Pass compiler flags
through to underlying compile call.
</content>
</entry>
<entry>
<title>Finishing touch to Ping's changes.  This is a patch that Ping sent me</title>
<updated>2001-03-23T17:54:43Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-03-23T17:54:43Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=66e8e86cf8a2f48a4aca1b05cef7fa7f6dd3ca48'/>
<id>urn:sha1:66e8e86cf8a2f48a4aca1b05cef7fa7f6dd3ca48</id>
<content type='text'>
but apparently he had to go to school, so I am checking it in for him.

This makes PyRun_HandleSystemExit() a static instead, called
handle_system_exit(), and let it use the current exception rather than
passing in an exception.  This slightly simplifies the code.
</content>
</entry>
<entry>
<title>call_sys_exitfunc():  Remove unused variable f.</title>
<updated>2001-03-23T17:34:02Z</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2001-03-23T17:34:02Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=6a12d8d3b4b7c70f92a17a20cb811b18069fd349'/>
<id>urn:sha1:6a12d8d3b4b7c70f92a17a20cb811b18069fd349</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Allow sys.excepthook and sys.exitfunc to quietly exit with a sys.exit().</title>
<updated>2001-03-23T15:36:41Z</updated>
<author>
<name>Ka-Ping Yee</name>
<email>ping@zesty.ca</email>
</author>
<published>2001-03-23T15:36:41Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=26fabb00167143aaf7458284ce7201103d9b28ff'/>
<id>urn:sha1:26fabb00167143aaf7458284ce7201103d9b28ff</id>
<content type='text'>
sys.exitfunc gets the last word on the exit status of the program.
</content>
</entry>
<entry>
<title>Fix memory leak with SyntaxError.  (The DECREF was originally hidden</title>
<updated>2001-03-23T04:01:07Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-03-23T04:01:07Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=4131830c23727aac262291934007c0b731b6e00c'/>
<id>urn:sha1:4131830c23727aac262291934007c0b731b6e00c</id>
<content type='text'>
inside a piece of code that was deemed reduntant; the DECREF was
unfortunately *not* redundant!)
</content>
</entry>
<entry>
<title>Add sys.excepthook.</title>
<updated>2001-03-23T02:46:52Z</updated>
<author>
<name>Ka-Ping Yee</name>
<email>ping@zesty.ca</email>
</author>
<published>2001-03-23T02:46:52Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b5c5132d1ac526dc97f8c51ef12299bde791a807'/>
<id>urn:sha1:b5c5132d1ac526dc97f8c51ef12299bde791a807</id>
<content type='text'>
Update docstring and library reference section on 'sys' module.
New API PyErr_Display, just for displaying errors, called by excepthook.
Uncaught exceptions now call sys.excepthook; if that fails, we fall back
    to calling PyErr_Display directly.
Also comes with sys.__excepthook__ and sys.__displayhook__.
</content>
</entry>
<entry>
<title>Extend support for from __future__ import nested_scopes</title>
<updated>2001-03-22T02:47:58Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2001-03-22T02:47:58Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=bc32024769eecd3c2251e00850e6a5c003aa9253'/>
<id>urn:sha1:bc32024769eecd3c2251e00850e6a5c003aa9253</id>
<content type='text'>
If a module has a future statement enabling nested scopes, they are
also enable for the exec statement and the functions compile() and
execfile() if they occur in the module.

If Python is run with the -i option, which enters interactive mode
after executing a script, and the script it runs enables nested
scopes, they are also enabled in interactive mode.

XXX The use of -i with -c "from __future__ import nested_scopes" is
not supported.  What's the point?

To support these changes, many function variants have been added to
pythonrun.c.  All the variants names end with Flags and they take an
extra PyCompilerFlags * argument.  It is possible that this complexity
will be eliminated in a future version of the interpreter in which
nested scopes are not optional.
</content>
</entry>
<entry>
<title>Useful future statement support for the interactive interpreter</title>
<updated>2001-03-01T22:59:14Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2001-03-01T22:59:14Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9f324e964e06c79f9c47501afa12b1af4cb1a75f'/>
<id>urn:sha1:9f324e964e06c79f9c47501afa12b1af4cb1a75f</id>
<content type='text'>
(Also remove warning about module-level global decl, because we can't
distinguish from code passed to exec.)

Define PyCompilerFlags type contains a single element,
cf_nested_scopes, that is true if a nested scopes future statement has
been entered at the interactive prompt.

New API functions:
    PyNode_CompileFlags()
    PyRun_InteractiveOneFlags()
    -- same as their non Flags counterparts except that the take an
       optional PyCompilerFlags pointer

compile.c: In jcompile() use PyCompilerFlags argument.  If
    cf_nested_scopes is true, compile code with nested scopes.  If it
    is false, but the code has a valid future nested scopes statement,
    set it to true.

pythonrun.c: Create a new PyCompilerFlags object in
    PyRun_InteractiveLoop() and thread it through to
    PyRun_InteractiveOneFlags().
</content>
</entry>
<entry>
<title>Now that Jeremy is asking about this code, it looks really bogus to me,</title>
<updated>2001-02-28T20:58:04Z</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2001-02-28T20:58:04Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b797f1f6d25c02d15f20f04681f39f2e75efb9b3'/>
<id>urn:sha1:b797f1f6d25c02d15f20f04681f39f2e75efb9b3</id>
<content type='text'>
so let's rip it out.  The constructor for SyntaxError does the right
thing, so we do not need to do it again.
</content>
</entry>
<entry>
<title>Print the offending line of code in the traceback for SyntaxErrors</title>
<updated>2001-02-28T07:07:43Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2001-02-28T07:07:43Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9f1b9932b87a6da14f2c010dfcf2ed08cb50b768'/>
<id>urn:sha1:9f1b9932b87a6da14f2c010dfcf2ed08cb50b768</id>
<content type='text'>
raised by the compiler.

XXX For now, text entered into the interactive intepreter is not
printed in the traceback.

Inspired by a patch from Roman Sulzhyk

compile.c:

Add helper fetch_program_text() that opens a file and reads until it
finds the specified line number.  The code is a near duplicate of
similar code in traceback.c.

Modify com_error() to pass two arguments to SyntaxError constructor,
where the second argument contains the offending text when possible.

Modify set_error_location(), now used only by the symtable pass, to
set the text attribute on existing exceptions.

pythonrun.c:

Change parse_syntax_error() to continue of the offset attribute of a
SyntaxError is None.  In this case, it sets offset to -1.

Move code from PyErr_PrintEx() into helper function
print_error_text().  In the helper, only print the caret for a
SyntaxError if offset &gt; 0.
</content>
</entry>
</feed>
