summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Cosmetics on Py_Get/SetRecursionLimit (for the style guide)Vladimir Marangozov2000-09-011-2/+4
|
* code part of patch #100895 by Fredrik LundhJeremy Hylton2000-09-011-4/+124
| | | | | PyErr_Format computes size of buffer needed rather than relying on static buffer.
* Revert removal of void from function definition. Guido sez I can take itTim Peters2000-09-011-1/+1
| | | | | out again after we complete switching to C++ <wink>. Thanks to Greg Stein for hitting me.
* refactor __del__ exception handler into PyErr_WriteUnraisableJeremy Hylton2000-09-011-0/+27
| | | | | add sanity check to gc: if an exception occurs during GC, call PyErr_WriteUnraisable and then call Py_FatalEror.
* Set the recursion limit to 1000 -- 2500 was not enough, let's beGuido van Rossum2000-09-011-1/+1
| | | | conservative.
* Supply missing prototypes for new Py_{Get,Set}RecursionLimit; fixes compiler ↵Tim Peters2000-09-011-1/+1
| | | | | | | wngs; un-analize Get's definition ("void" is needed only in declarations, not defns, & is generally considered bad style in the latter).
* add user-modifiable recursion_limitJeremy Hylton2000-08-312-8/+66
| | | | | | | | | | | ceval.c: define recurion_limit (static), default value is 2500 define Py_GetRecursionLimit and Py_SetRecursionLimit raise RuntimeError if limit is exceeded PC/config.h: remove plat-specific definition sysmodule.c: add sys.(get|set)recursionlimit
* _PySys_Init(): When setting up sys.version_info, use #if/#elif.../#endifFred Drake2000-08-311-6/+3
| | | | | instead of four #if/#endif blocks. This shortens the code and improves readability.
* PyOS_CheckStack(): Better ANSI'fy this while we're at it.Fred Drake2000-08-311-1/+1
|
* Add a comment explaining the return value of PyOS_CheckStack().Fred Drake2000-08-311-1/+4
|
* Better error message with UnboundLocalErrorPaul Prescod2000-08-301-11/+39
|
* eval_code2(): Guido provides this patch for his suggested elaborationBarry Warsaw2000-08-291-2/+2
| | | | | of extended print. If the file object being printed to is None, then sys.stdout is used.
* Replace the run-time 'future-bytecode-stream-inspection' hack to find outThomas Wouters2000-08-273-59/+19
| | | | | | | how 'import' was called with a compiletime mechanism: create either a tuple of the import arguments, or None (in the case of a normal import), add it to the code-block constants, and load it onto the stack before calling IMPORT_NAME.
* Hard to believe Guido compiled this! Function lacked a return stmt.Tim Peters2000-08-271-1/+1
|
* Re-allow 'import mod.submod as s', and change its meaning to what it shouldThomas Wouters2000-08-271-2/+5
| | | | mean; the same as 'from mod import submod as s'.
* Add three new APIs: PyRun_AnyFileEx(), PyRun_SimpleFileEx(),Guido van Rossum2000-08-272-11/+34
| | | | | | | | | | | | | | 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)
* implements PyOS_CheckStack for Windows and MSVC. this fixes aFredrik Lundh2000-08-271-0/+29
| | | | | | couple of potential stack overflows, including bug #110615. closes patch #101238
* Oops, one pop too many.Thomas Wouters2000-08-271-1/+0
|
* Charles Waldman's patch to reinitialize the interpreter lock after aGuido van Rossum2000-08-271-0/+19
| | | | | | | fork. This solves the test_fork1 problem. (ceval.c, signalmodule.c, intrcheck.c) SourceForge: [ Patch #101226 ] make threading fork-safe
* Fix to [ Bug #111165 ] doc-string removal masked by PYTHONOPTIMIZEMarc-André Lemburg2000-08-251-3/+3
|
* Fix allowable node-types for assignment, need to add 'listmaker'.Thomas Wouters2000-08-251-1/+1
| | | | | | | (This fix is a bit broken, just as the test already was: the test for testlist and listmaker are done always, whereas the test for exprlist and the actual abort() are only done if Py_DEBUG is defined. Suggestions welcome, I guess ;)
* Improve the exceptions raised by PyErr_BadInternalCall(); adding theFred Drake2000-08-241-2/+15
| | | | | | filename and line number of the call site to allow esier debugging. This closes SourceForge patch #101214.
* Support for three-token characters (**=, >>=, <<=) which was written byThomas Wouters2000-08-244-791/+1195
| | | | | Michael Hudson, and support in general for the augmented assignment syntax. The graminit.c patch is large!
* Charles G. Waldman <cgw@fnal.gov>:Fred Drake2000-08-242-2/+38
| | | | | | | | | Add the EXTENDED_ARG opcode to the virtual machine, allowing 32-bit arguments to opcodes instead of being forced to stick to the 16-bit limit. This is especially useful for machine-generated code, which can be too long for the SET_LINENO parameter to fit into 16 bits. This closes the implementation portion of SourceForge patch #100893.
* This patch partly (some stuff went in already) ports Python to Monterey.Trent Mick2000-08-231-0/+11
| | | | | | | | | | - Fix bug in thread_pthread.h::PyThread_get_thread_ident() where sizeof(pthread) < sizeof(long). - Add 'configure' for: - SIZEOF_PTHREAD is pthread_t can be included via <pthread.h> - setting Monterey system name - appropriate CC,LINKCC,LDSHARED,OPT, and CCSHARED for Monterey - Add section in README for Monterey build
* Remove the dependency information for version.o; this is not part ofFred Drake2000-08-231-1/+0
| | | | the sources/build process any more.
* require list comprehensions to start with a for clauseSkip Montanaro2000-08-222-9/+9
|
* com_print_stmt(): Guido rightly points out that the stream expressionBarry Warsaw2000-08-211-5/+22
| | | | | in extended prints should only be evaluated once. This patch plays stack games (documented!) to fix this.
* Thomas reminds me to bump the MAGIC number for the extended printBarry Warsaw2000-08-211-1/+1
| | | | opcode additions.
* PEP 214, Extended print Statement, has been accepted by the BDFL.Barry Warsaw2000-08-212-138/+184
| | | | | | | eval_code2(): Implement new bytecodes PRINT_ITEM_TO and PRINT_NEWLINE_TO, as per accepted SF patch #100970. Also update graminit.c based on related Grammar/Grammar changes.
* PEP 214, Extended print Statement, has been accepted by the BDFL.Barry Warsaw2000-08-211-8/+36
| | | | | | com_print_stmt(): Implement recognition of, and byte compilation for, extended print using new byte codes PRINT_ITEM_TO and PRINT_NEWLINE_TO.
* Fix the bug Sjoerd Mullender discovered, where find_from_args() wasn'tThomas Wouters2000-08-201-1/+3
| | | | | | | | | | trying hard enough to find out what the arguments to an import were. There is no test-case for this bug, yet, but this is what it looked like: from encodings import cp1006, cp1026 ImportError: cannot import name cp1026 '__import__' was called with only the first name in the 'arguments' list.
* Disallow "import mod.submod as m", because the result is ambiguous. Does itThomas Wouters2000-08-191-1/+2
| | | | | | | | | | load mod.submod as m, or mod as m ? Both can be achieved differently, and unambiguously. Also attempt to document this restriction (editor appreciated!) Note that this is an artificial check during compile, because incorporating this in the grammar is hard, and then adjusting the compiler to do the right thing with the right nodes is harder.
* com_error(): Quiet gcc -Wall warning.Barry Warsaw2000-08-181-1/+0
|
* Remove a couple of warnings turned up by "gcc -Wall".Fred Drake2000-08-182-3/+4
|
* Do not set a MemoryError exception over another MemoryError exception,Vladimir Marangozov2000-08-181-0/+4
| | | | thus preserving the first one that has been raised.
* SyntaxError__classinit__(): Slight reorg for simplicity.Barry Warsaw2000-08-181-4/+4
|
* comples_from_string(): Move s_buffer[] up to the top-level functionBarry Warsaw2000-08-181-2/+1
| | | | | | scope. Previously, s_buffer[] was defined inside the PyUnicode_Check() scope, but referred to in the outer scope via assignment to s. This quiets an Insure portability warning.
* Apply SF patch #101135, adding 'import module as m' and 'from module importThomas Wouters2000-08-174-690/+793
| | | | | | | | name as n'. By doing some twists and turns, "as" is not a reserved word. There is a slight change in semantics for 'from module import name' (it will now honour the 'global' keyword) but only in cases that are explicitly undocumented.
* _PySys_Init(): Fix another Insure discovered memory leak; the PyStringBarry Warsaw2000-08-161-1/+2
| | | | created from the "big"/"little" constant needs to be decref'd.
* SyntaxError__str__(): Fix two memory problems discovered by Insure.Barry Warsaw2000-08-161-4/+9
| | | | | | | First, the allocated buffer was never freed after using it to create the PyString object. Second, it was possible that have_filename would be false (meaning that filename was not a PyString object), but that the code would still try to PyString_GET_SIZE() it.
* Fix new compiler warnings. Unused var in compile.c. Argsize mismatchesTim Peters2000-08-151-1/+0
| | | | | | in binascii.c (only on platforms with signed chars -- although Py_CHARMASK is documented as returning an int, it only does so on platforms with signed chars).
* my_basename(): Removes the leading path components from a path name,Fred Drake2000-08-151-2/+23
| | | | | | | | returning a pointer to the start of the file's "base" name; similar to os.path.basename(). SyntaxError__str__(): Use my_basename() to keep the length of the file name included in the exception message short.
* Remove the osdefs.h #include; it was not needed in the final version ofFred Drake2000-08-152-2/+0
| | | | my last set of changes.
* When raising a SyntaxError, make a best-effort attempt to set theFred Drake2000-08-151-9/+29
| | | | | | | | | | 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). Wrap a long line to fit in under 80 columns.
* When raising a SyntaxError, make a best-effort attempt to set theFred Drake2000-08-151-1/+19
| | | | | | | | 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).
* SyntaxError__str__(): Do more formatting of the exception here, ratherFred Drake2000-08-151-6/+55
| | | | | | | | | than depending on the site that raises the exception. If the filename and lineno attributes are set on the exception object, use them to augment the message displayed. This is part of what is needed to close SoruceForge bug #110628 (Jitterbug PR#278).
* Guido pointed out that all names in the sys module have no underscore,Fred Drake2000-08-151-4/+5
|
* Fix the parent of WindowsError - both the comments in this source file, and ↵Mark Hammond2000-08-151-1/+1
| | | | the previous exceptions.py have WindowsError as a sub-class of OSError.
* The attempt to protect against MS_WIN16 compilers that do not support longFred Drake2000-08-141-1/+2
| | | | | | string literals has not been tested on an MS_WIN16 platform; the trailing ";" was inside the #ifndef MS_WIN16, which should cause an error (missing semi-colon) when compiled with that symbol #defined.