0
0
mirror of https://github.com/python/cpython.git synced 2024-12-14 12:26:47 +08:00
Commit Graph

22 Commits

Author SHA1 Message Date
Guido van Rossum
4b499dd3fb - Finally fixed the bug in compile() and exec where a string ending
with an indented code block but no newline would raise SyntaxError.
  This would have been a four-line change in parsetok.c...  Except
  codeop.py depends on this behavior, so a compilation flag had to be
  invented that causes the tokenizer to revert to the old behavior;
  this required extra changes to 2 .h files, 2 .c files, and 2 .py
  files.  (Fixes SF bug #501622.)
2003-02-13 22:07:59 +00:00
Tim Peters
bc0e910826 Convert a pile of obvious "yes/no" functions to return bool. 2002-04-04 22:55:58 +00:00
Skip Montanaro
acb29aed67 make default banner match what the real interpreter displays 2002-03-25 22:04:23 +00:00
Skip Montanaro
0679a73c0e remove unqualified excepts - catch ImportError when trying to import
readline and get rid of string exception fallback when showing syntax
errors.
see bug 411881
2002-03-25 21:44:07 +00:00
Guido van Rossum
555d12f986 softspace(): be prepared to catch AttributeError as well as TypeError
upon attempted attribute assignment.  Caught by MWH, SF bug .
2001-09-18 13:33:01 +00:00
Tim Peters
6cd6a82db9 A fiddled version of the rest of Michael Hudson's SF patch
 supporting __future__ in simulated shells
which implements PEP 264.
2001-08-17 22:11:27 +00:00
Fred Drake
c7745d4b54 InteractiveInterpreter.showsyntaxerror():
When replacing the exception object, be sure we stuff the new value
    in sys.last_value (which we already did for the original value).
2001-05-03 04:58:49 +00:00
Eric S. Raymond
6b71e747b1 String method conversion. 2001-02-09 08:56:30 +00:00
Skip Montanaro
e99d5ea25b added __all__ lists to a number of Python modules
added test script and expected output file as well
this closes patch 103297.
__all__ attributes will be added to other modules without first submitting
a patch, just adding the necessary line to the test script to verify
more-or-less correct implementation.
2001-01-20 19:54:20 +00:00
Guido van Rossum
48450cf0a9 mwh@sourceforge found that UnicodeError can be raised by compiling.
Its base class ValueError can be raised too, so catch that.
2001-01-15 18:13:35 +00:00
Guido van Rossum
c5f15b088f Make the copyright message the same as for the "real" interpreter. 2001-01-14 23:04:22 +00:00
Guido van Rossum
4ec59c75e3 SF Patch by mwh: make code.py appreciate softspace 2001-01-13 22:10:41 +00:00
Guido van Rossum
7dd06966cb Make Traceback header conform to new traceback ("innermost last" ->
"most recent call last").
2000-12-27 19:12:58 +00:00
Guido van Rossum
98d9fd3e68 Simple changes by Gerrit Holl - move author acknowledgements out of
docstrings into comments.
2000-02-28 15:12:25 +00:00
Guido van Rossum
5d42b5b74d Moved compile_command() to a file of its own (codeop.py). 1998-10-22 21:56:44 +00:00
Guido van Rossum
d90ae19b92 Rename 'locals' argument to top-level interact() function to 'local'
for b/w compatibility with 1.5.1.
1998-10-19 18:42:53 +00:00
Guido van Rossum
5227f0fdcd Reworked it quite a bit. There are now two classes: a base class,
InteractiveInterpreter, which handles parsing and interpreter state
but doesn't know deal with buffering or prompting or input file
naming.  And a derived class, InteractiveConsole, which adds buffering
and prompting and supports setting the filename once.  Also tweak the
algorithm in compile_command() a bit so that input consisting of all
blank lines or comments always succeeds immediately, and note the fact
that apart from SyntaxError it can also raise OverflowError.
1998-09-22 20:38:53 +00:00
Guido van Rossum
a93b848e33 Subsume the interact() function in a class. This should make it
possible to use this in PythonWin, and to replace Fredrik Lundh's
PythonInterpreter class.  Fredrik is credited with the class' API.
1998-06-23 19:31:19 +00:00
Guido van Rossum
45e2fbc2e7 Mass check-in after untabifying all files that need it. 1998-03-26 21:13:24 +00:00
Guido van Rossum
8687164426 Seems I've found a way to fix this. 1998-01-14 15:40:30 +00:00
Guido van Rossum
90981e0e70 Add Jeff Epler's interact() function. Note that it is broken.
(It should probably be withdrawn :-( )
1997-10-07 14:47:24 +00:00
Guido van Rossum
1557a7314c Checking in new module code.py -- utilities dealing with code objects.
Currently, contains one function: compile_command(), which helps
determining whether a source string is complete, incomplete or in
error.  This is useful when writing your own version of the Python
read-eval-print loop.
1997-07-18 16:57:52 +00:00