- 02 Aug, 2001 1 commit
-
-
Tim Peters authored
-
- 23 Jul, 2001 1 commit
-
-
Neil Schemenauer authored
and PYTHONPATH).
-
- 16 Jul, 2001 4 commits
-
-
Guido van Rossum authored
PyParser_SimpleParseString(). Now calls PyParser_SimpleParseStringFlags() with the correct flag.
-
Tim Peters authored
that 'yield' is a keyword. This doesn't help test_generators at all! I don't know why not. These things do work now (and didn't before this patch): 1. "from __future__ import generators" now works in a native shell. 2. Similarly "python -i xxx.py" now has generators enabled in the shell if xxx.py had them enabled. 3. This program (which was my doctest proxy) works fine: from __future__ import generators source = """\ def f(): yield 1 """ exec compile(source, "", "single") in globals() print type(f())
-
Tim Peters authored
pythonrun.c, run_pyc_file(): repair semantic error wrt CO_GENERATOR vs CO_GENERATOR_ALLOWED.
-
Tim Peters authored
that info to code dynamically compiled *by* code compiled with generators enabled. Doesn't yet work because there's still no way to tell the parser that "yield" is OK (unlike nested_scopes, the parser has its fingers in this too). Replaced PyEval_GetNestedScopes by a more-general PyEval_MergeCompilerFlags. Perhaps I should not have? I doubted it was *intended* to be part of the public API, so just did.
-
- 13 Jun, 2001 1 commit
-
-
Marc-André Lemburg authored
about this...
-
- 26 Mar, 2001 1 commit
-
-
Jeremy Hylton authored
using nested scopes to compile its argument. Pass compiler flags through to underlying compile call.
-
- 23 Mar, 2001 5 commits
-
-
Guido van Rossum authored
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.
-
Fred Drake authored
-
Ka-Ping Yee authored
sys.exitfunc gets the last word on the exit status of the program.
-
Guido van Rossum authored
inside a piece of code that was deemed reduntant; the DECREF was unfortunately *not* redundant!)
-
Ka-Ping Yee authored
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__.
-
- 22 Mar, 2001 1 commit
-
-
Jeremy Hylton authored
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.
-
- 01 Mar, 2001 1 commit
-
-
Jeremy Hylton authored
(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().
-
- 28 Feb, 2001 2 commits
-
-
Fred Drake authored
so let's rip it out. The constructor for SyntaxError does the right thing, so we do not need to do it again.
-
Jeremy Hylton authored
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 > 0.
-
- 17 Feb, 2001 1 commit
-
-
Tim Peters authored
Miserable hack to replace the previous miserable hack in maybe_pyc_file.
-
- 11 Feb, 2001 1 commit
-
-
Tim Peters authored
Bug was introduced by tricks played to make .pyc files executable via cmdline arg. Then again, -x worked via a trick to begin with. If anyone can think of a portable way to test -x, be my guest!
-
- 02 Feb, 2001 1 commit
-
-
Jeremy Hylton authored
symtable.h, so that they can be used by external module. Improve error handling in symtable_enter_scope(), which return an error code that went unchecked by most callers. XXX The error handling in symtable code is sloppy in general. Modify symtable to record the line number that begins each scope. This can help to identify which code block is being referred to when multiple blocks are bound to the same name. Add st_scopes dict that is used to preserve scope info when PyNode_CompileSymtable() is called. Otherwise, this information is tossed as soon as it is no longer needed. Add Py_SymtableString() to pythonrun; analogous to Py_CompileString().
-
- 28 Jan, 2001 1 commit
-
-
Tim Peters authored
They're named as if public, so I did a Bad Thing by changing PyMarshal_ReadObjectFromFile() to suck up the remainder of the file in one gulp: anyone who counted on that leaving the file pointer merely at the end of the next object would be screwed. So restored PyMarshal_ReadObjectFromFile() to its earlier state, renamed the new greedy code to PyMarshal_ReadLastObjectFromFile(), and changed Python internals to call the latter instead.
-
- 21 Jan, 2001 1 commit
-
-
Tim Peters authored
pythonrun.c: In Py_Finalize, don't reset the initialized flag until after the exit funcs have run. atexit.py: in _run_exitfuncs, mutate the list of pending calls in a threadsafe way. This wasn't a contributor to bug 128475, it just burned my eyeballs when looking at that bug.
-
- 17 Jan, 2001 1 commit
-
-
Guido van Rossum authored
-
- 05 Jan, 2001 1 commit
-
-
Tim Peters authored
has type int in C.
-
- 04 Jan, 2001 1 commit
-
-
Martin v. Löwis authored
Patch #103067 with modifications as discussed in email.
-
- 16 Sep, 2000 1 commit
-
-
Guido van Rossum authored
sigaction() (if HAVE_SIGACTION is defined).
-
- 01 Sep, 2000 1 commit
-
-
Guido van Rossum authored
This should match the situation in the 1.6b1 tree.
-
- 31 Aug, 2000 2 commits
-
-
Fred Drake authored
-
Fred Drake authored
-
- 27 Aug, 2000 3 commits
-
-
Tim Peters authored
-
Guido van Rossum authored
PyRun_FileEx(). These are the same as their non-Ex counterparts but have an extra argument, a flag telling them to close the file when done. Then this is used by Py_Main() and execfile() to close the file after it is parsed but before it is executed. Adding APIs seems strange given the feature freeze but it's the only way I see to close the bug report without incompatible changes. [ Bug #110616 ] source file stays open after parsing is done (PR#209)
-
Fredrik Lundh authored
couple of potential stack overflows, including bug #110615. closes patch #101238
-
- 25 Aug, 2000 1 commit
-
-
Marc-André Lemburg authored
-
- 15 Aug, 2000 2 commits
-
-
Fred Drake authored
my last set of changes.
-
Fred Drake authored
filename and lineno attributes, but do not mask the SyntaxError if we fail. This is part of what is needed to close SoruceForge bug #110628 (Jitterbug PR#278).
-
- 22 Jul, 2000 1 commit
-
-
Thomas Wouters authored
declarations yet, those come later.
-
- 16 Jul, 2000 1 commit
-
-
Thomas Wouters authored
comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
-
- 11 Jul, 2000 2 commits
-
-
Jack Jansen authored
mac-specific functions to have a PyMac_ name.
-
Fred Drake authored
used for indentation related errors. This patch includes Ping's improvements for indentation-related error messages. Closes SourceForge patches #100734 and #100856.
-
- 09 Jul, 2000 1 commit
-
-
Tim Peters authored
-