summaryrefslogtreecommitdiffstats
path: root/Lib/code.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix issue #1707. When raw_input() was removed, it was incorrectly replacedGuido van Rossum2008-01-021-5/+4
| | | | | with sys.stdin.readline(). I wonder how many other places are affected by the same bug?
* Merged revisions 56492-56752 via svnmerge fromGuido van Rossum2007-08-051-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r56497 | kurt.kaiser | 2007-07-22 14:55:16 -0700 (Sun, 22 Jul 2007) | 4 lines In the case of syntax errors, in py3k format_exception_only() was including line number and position in the final line of the exception notification, duplicating info in previous lines. ........ r56501 | kurt.kaiser | 2007-07-22 19:35:50 -0700 (Sun, 22 Jul 2007) | 2 lines Hum, needed a newline in the last change. ........ r56536 | kurt.kaiser | 2007-07-24 19:06:48 -0700 (Tue, 24 Jul 2007) | 5 lines Not all instantiations of SyntaxError set the args attribute. e.g. symtable.c Modify format_exception_only() to get SyntaxError attributes directly instead of unpacking 'args'. ........ r56537 | kurt.kaiser | 2007-07-24 19:13:03 -0700 (Tue, 24 Jul 2007) | 3 lines Update doctest strings: traceback.py no longer prints redundant location information in the last line of the exception display. ........ r56627 | kurt.kaiser | 2007-07-29 21:06:57 -0700 (Sun, 29 Jul 2007) | 2 lines Interactive interpreter emulator (code.py) failing to print exceptions. ........ r56628 | kurt.kaiser | 2007-07-29 21:41:02 -0700 (Sun, 29 Jul 2007) | 2 lines Eliminate extra lines before and after tracebacks. ........ r56638 | kurt.kaiser | 2007-07-31 19:36:45 -0700 (Tue, 31 Jul 2007) | 3 lines Refactor syntax error display in shell and edit windows; move colorize_syntax_error() to EditorWindow; update to py3k. ........ r56685 | neal.norwitz | 2007-08-02 22:20:23 -0700 (Thu, 02 Aug 2007) | 10 lines Remove several h/w and o/s specific modules that are undocumented, obsolete, and/or not widely used: linuxaudiodev.c, sunaudiodev.c Lib/plat-sunos5/SUNAUDIODEV.py Lib/audiodev.py Tools/audiopy/audiopy Move Lib/toaiff.py to Demo. See PEP 3108 for most of the details. ........ r56686 | neal.norwitz | 2007-08-02 22:21:48 -0700 (Thu, 02 Aug 2007) | 4 lines Missed one module that should have been removed since it relied on audiodev which was removed. ........ r56748 | neal.norwitz | 2007-08-04 19:19:04 -0700 (Sat, 04 Aug 2007) | 1 line Make from X import * outside module scope an error. ........ r56750 | neal.norwitz | 2007-08-04 19:35:01 -0700 (Sat, 04 Aug 2007) | 1 line Use READONLY consistently instead of RO ........
* Kill off softspace completely (except in formatter.py which seems to haveGuido van Rossum2007-02-091-16/+0
| | | | | a different feature with the same name). The change to test_doctest.txt reduces the doctest failures to 3.
* Fix most trivially-findable print statements.Guido van Rossum2007-02-091-1/+1
| | | | | | | | | There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
* Patch #1550800: make exec a function.Georg Brandl2006-09-061-1/+1
|
* Get rid of a bunch more raw_input referencesNeal Norwitz2006-03-171-4/+6
|
* - Finally fixed the bug in compile() and exec where a string endingGuido van Rossum2003-02-131-1/+2
| | | | | | | | | 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.)
* Convert a pile of obvious "yes/no" functions to return bool.Tim Peters2002-04-041-4/+4
|
* make default banner match what the real interpreter displaysSkip Montanaro2002-03-251-1/+1
|
* remove unqualified excepts - catch ImportError when trying to importSkip Montanaro2002-03-251-7/+2
| | | | | | readline and get rid of string exception fallback when showing syntax errors. see bug 411881
* softspace(): be prepared to catch AttributeError as well as TypeErrorGuido van Rossum2001-09-181-1/+2
| | | | upon attempted attribute assignment. Caught by MWH, SF bug #462522.
* A fiddled version of the rest of Michael Hudson's SF patchTim Peters2001-08-171-3/+4
| | | | | #449043 supporting __future__ in simulated shells which implements PEP 264.
* InteractiveInterpreter.showsyntaxerror():Fred Drake2001-05-031-0/+1
| | | | | When replacing the exception object, be sure we stuff the new value in sys.last_value (which we already did for the original value).
* String method conversion.Eric S. Raymond2001-02-091-2/+1
|
* added __all__ lists to a number of Python modulesSkip Montanaro2001-01-201-0/+3
| | | | | | | | 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.
* mwh@sourceforge found that UnicodeError can be raised by compiling.Guido van Rossum2001-01-151-1/+1
| | | | Its base class ValueError can be raised too, so catch that.
* Make the copyright message the same as for the "real" interpreter.Guido van Rossum2001-01-141-1/+2
|
* SF Patch #103227 by mwh: make code.py appreciate softspaceGuido van Rossum2001-01-131-0/+14
|
* Make Traceback header conform to new traceback ("innermost last" ->Guido van Rossum2000-12-271-1/+1
| | | | "most recent call last").
* Simple changes by Gerrit Holl - move author acknowledgements out ofGuido van Rossum2000-02-281-1/+2
| | | | docstrings into comments.
* Moved compile_command() to a file of its own (codeop.py).Guido van Rossum1998-10-221-82/+3
|
* Rename 'locals' argument to top-level interact() function to 'local'Guido van Rossum1998-10-191-3/+3
| | | | for b/w compatibility with 1.5.1.
* Reworked it quite a bit. There are now two classes: a base class,Guido van Rossum1998-09-221-102/+206
| | | | | | | | | | 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.
* Subsume the interact() function in a class. This should make itGuido van Rossum1998-06-231-42/+197
| | | | | possible to use this in PythonWin, and to replace Fredrik Lundh's PythonInterpreter class. Fredrik is credited with the class' API.
* Mass check-in after untabifying all files that need it.Guido van Rossum1998-03-261-45/+45
|
* Seems I've found a way to fix this.Guido van Rossum1998-01-141-3/+9
|
* Add Jeff Epler's interact() function. Note that it is broken.Guido van Rossum1997-10-071-0/+52
| | | | (It should probably be withdrawn :-( )
* Checking in new module code.py -- utilities dealing with code objects.Guido van Rossum1997-07-181-0/+52
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.