summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Neil discovered a bad DECREF on warnoptions, that caused repeatedGuido van Rossum2001-01-131-2/+1
| | | | | | re-initializing Python (Py_Finalize() followed by Py_Initialize()) to blow up quickly. With the DECREF removed I can't get it to fail any more. (Except it still leaks, but that's probably a separate issue.)
* Update the docstring for apply() so that "args" is marked as optionalFred Drake2001-01-121-1/+1
| | | | (since it is).
* Two changes to from...import:Guido van Rossum2001-01-121-30/+54
| | | | | | | | | | | 1) "from M import X" now works even if M is not a real module; it's basically a getattr() operation with AttributeError exceptions changed into ImportError. 2) "from M import *" now looks for M.__all__ to decide which names to import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but filters out names starting with '_' as before. Whether or not __all__ exists, there's no restriction on the type of M.
* (Modified) patch by Ping - SF Patch #102681.Guido van Rossum2001-01-121-27/+33
| | | | | | | | | - Make error messages from issubclass() and isinstance() a bit more descriptive (Ping, modified by Guido) - Couple of tiny fixes to other docstrings (Ping) - Get rid of trailing whitespace (Guido)
* Fixed bugs noted by Greg SteinMoshe Zadka2001-01-111-0/+2
| | | | | * x wasn't initialized to NULL * Did not DECREF result from displayhook function
* stdout is sometimes a macro; use "outf" instead.Greg Stein2001-01-111-5/+5
| | | | Submitted by: Mark Favas <m.favas@per.dem.csiro.au>
* Implementation of PEP-0217.Moshe Zadka2001-01-112-27/+63
| | | | This closes the PEP, and patch 103170
* Add missing Py_DECREF in fast_cfunction. Partial fix for SF bugCharles G. Waldman2001-01-101-3/+6
| | | | #127699.
* Oops, one more part of the cygwin patch (SF patch #102409 by jlt63:Guido van Rossum2001-01-101-1/+1
| | | | | | | | Cygwin Python DLL and Shared Extension Patch). Add module.dll as a valid extension. jlt63 writes: Note that his change essentially backs out the fix for bug #115973. Should ".pyd" be retained instead for posterity?
* SF Patch #103154 by jlt63: Cygwin Check Import Case Patch.Guido van Rossum2001-01-101-1/+13
| | | | | Note: I've reordered acconfig.h and config.h.in to obtain alphabetical order (modulo case and leading _).
* Fix signed/unsigned wng. Unfortunately, (unsigned char) << intTim Peters2001-01-051-2/+2
| | | | has type int in C.
* When a PyCFunction that takes only positional parameters is called withFred Drake2001-01-041-18/+19
| | | | | | | | | | an empty keywords dictionary (via apply() or the extended call syntax), the keywords dict should be ignored. If the keywords dict is not empty, TypeError should be raised. (Between the restructuring of the call machinery and this patch, an empty dict in this situation would trigger a SystemError via PyErr_BadInternalCall().) Added regression tests to detect errors for this.
* Recognize pyc files even if they don't end in pyc.Martin v. Löwis2001-01-041-7/+33
| | | | Patch #103067 with modifications as discussed in email.
* Add NotImplemented to the builtin module.Neil Schemenauer2001-01-041-0/+3
|
* Revised implementation of CALL_FUNCTION and friends.Jeremy Hylton2001-01-031-296/+429
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More revision still needed. Much of the code that was in the mainloop was moved to a series of helper functions. PyEval_CallObjectWithKeywords was split into two parts. The first part now only does argument handling. The second part is now named call_object and delegates the call to a call_(function,method,etc.) helper. XXX The call_XXX helper functions should be replaced with tp_call functions for the respective types. The CALL_FUNCTION implementation contains three kinds of optimization: 1. fast_cfunction and fast_function are called when the arguments on the stack can be passed directly to eval_code2() without copying them into a tuple. 2. PyCFunction objects are dispatched immediately, because they are presumed to occur more often than anything else. 3. Bound methods are dispatched inline. The method object contains a pointer to the function object that will be called. The function is called from within the mainloop, which may allow optimization #1 to be used, too. The extened call implementation -- f(*args) and f(**kw) -- are implemented as a separate case in the mainloop. This allows the common case of normal function calls to execute without wasting time on checks for extended calls, although it does introduce a small amount of code duplication. Also, the unused final argument of eval_code2() was removed. This is probably the last trace of the access statement :-).
* CHange error messages for ord(), using "string" instead of "string or Unicode"Andrew M. Kuchling2000-12-231-2/+3
|
* Whoops! Two stray characters crept in to my last check-inAndrew M. Kuchling2000-12-201-1/+1
|
* Patch #102955, fixing one of the warnings in bug #121479:Andrew M. Kuchling2000-12-201-5/+7
| | | | | Simplifies ord()'s logic at the cost of some code duplication, removing a " `ord' might be used uninitialized in this function" warning
* Add definitions for PySys_ResetWarnOptions() andGuido van Rossum2000-12-151-0/+39
| | | | PySys_AddWarnOption().
* Add PyErr_Warn().Guido van Rossum2000-12-151-0/+34
|
* Add definitions for standard warning category classes (PyExc_WarningGuido van Rossum2000-12-151-0/+36
| | | | etc.).
* Use c2pstr() in stead of Pstring() to convert C-strings toJack Jansen2000-12-121-3/+4
| | | | | Pascal-strings. Safer, because Pstring converts in-place and the pathname may be reused later for error messages.
* vgetargskeywords(): Patch for memory leak identified in bug #119862.Barry Warsaw2000-12-111-0/+1
|
* _getframe(): New sys module function for getting at the stack frame.Barry Warsaw2000-12-061-0/+37
| | | | | Implements and closes SF patch #102106, with Guido's suggested documentation changes.
* Make isinstance() more permissive in what types of arguments itNeil Schemenauer2000-12-041-17/+9
| | | | | accepts. Clarify exception messages for isinstance() and issubclass(). Closes bug #124106.
* Clarified some of the error messages, esp. "read-only characterGuido van Rossum2000-12-011-17/+16
| | | | buffer" replaced by "string or read-only character buffer".
* Plug a memory leak in com_import_stmt(): the tuple created to hold theGuido van Rossum2000-11-271-1/+2
| | | | | | "..." in "from M import ..." was never DECREFed. Leak reported by James Slaughter and nailed by Barry, who also provided an earlier version of this patch.
* SF bug 119622: compile errors due to redundant atof decls. I don't understandTim Peters2000-11-142-3/+0
| | | | | | the bug report (for details, look at it), but agree there's no need for Python to declare atof itself: we #include stdlib.h, and ANSI C sez atof is declared there already.
* Fix syntax error. Submitted by Bill Bumgarner. Apparently this isGuido van Rossum2000-11-131-1/+1
| | | | still in use, for Apple Mac OSX.
* Rip out DOS-8x3 support.Guido van Rossum2000-11-131-17/+2
|
* Move our own getopt() implementation to _PyOS_GetOpt(), and use itThomas Wouters2000-11-032-32/+19
| | | | | | | | | regardless of whether the system getopt() does what we want. This avoids the hassle with prototypes and externs, and the check to see if the system getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to avoid name clashes. Add new include file to define the right symbols. Fix Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on Python to provide it.
* Fix for SF bug #117241Jeremy Hylton2000-10-301-1/+15
| | | | | | | | | When a method is called with no regular arguments and * args, defer the first arg is subclass check until after the * args have been expanded. N.B. The CALL_FUNCTION implementation is getting really hairy; should review it to see if it can be simplified.
* Patch 102114, Bug 11725. On OpenBSD (but apparently not on the otherGuido van Rossum2000-10-251-2/+7
| | | | BSDs) you need a leading underscore in the dlsym() lookup name.
* Ka-Ping Yee <ping@lfw.org>:Fred Drake2000-10-244-57/+76
| | | | | | Changes to error messages to increase consistency & clarity. This (mostly) closes SourceForge patch #101839.
* Andy Dustman <adustman@users.sourceforge.net>:Fred Drake2000-10-121-3/+0
| | | | Eliminate unused variables to appease compiler.
* Do a better job at staying on-screen :P (Sorry, it's late here.) I'mThomas Wouters2000-10-111-1/+2
| | | | | assuming here that the ANSI-C adjacent-string-concatenation technique is allowable, now that Python requires an ANSI C compiler.
* Adjust debugging code in the implementation of the DUP_TOPX bytecode, useThomas Wouters2000-10-111-5/+1
| | | | | Py_FatalError() instead, and clarify the message somewhat. As discussed on python-dev.
* Remove the last gcc -Wall warning about possible use of an uninitializedFred Drake2000-10-111-0/+1
| | | | | | variable. w should be initialized before entering the bytecode interpretation loop since we only need one initialization to satisfy the compiler.
* Attempt to fix bogus gcc -Wall warnings reported by Marc-Andre Lemburg,Tim Peters2000-10-111-31/+61
| | | | | | by making the DUP_TOPX code utterly straightforward. This also gets rid of all normal-case internal DUP_TOPX if/branches, and allows replacing one POP() with TOP() in each case, so is a good idea regardless.
* Avoid a couple of "value computed is not used" warnings from gcc -Wall;Fred Drake2000-10-101-2/+2
| | | | | | | these computations are required for their side effects in traversing the variable arguments list. Reported by Marc-Andre Lemburg <mal@lemburg.com>.
* Donn Cave <donn@u.washington.edu>:Fred Drake2000-10-061-1/+1
| | | | | | | | Do not assume that all platforms using a MetroWorks compiler can use POSIX threads; the assumption breaks on BeOS. This fix only helps for BeOS. This closes SourceForge patch #101772.
* SF "bug" 115973: patches from Norman Vine so that shared libraries andTim Peters2000-10-051-0/+5
| | | | Tkinter work under Cygwin. Accepted on faith & reasonableness.
* Detect conflicting Python DLL on module import under Windows - as per [ ↵Mark Hammond2000-10-051-1/+152
| | | | Patch #101676 ]
* _PyImport_Fini(): Closed small memory leak when an embedded app callsBarry Warsaw2000-10-031-0/+2
| | | | | Py_Initialize()/Py_Finalize() in a loop. _PyImport_Filetab needed to be deallocated. Partial closure of SF #110681, Jitterbug PR#398.
* The 2.0b2 change to write .pyc files in exclusive mode (if possible)Tim Peters2000-09-291-1/+6
| | | | | | | | unintentionally caused them to get written in text mode under Windows. As a result, when .pyc files were later read-- in binary mode --the magic number was always wrong (note that .pyc magic numbers deliberately include \r and \n characters, so this was "good" breakage, 100% across all .pyc files, not random corruption in a subset). Fixed that.
* Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake2000-09-266-24/+0
| | | | | | | | Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
* Andrew Kuchling <akuchlin@mems-exchange.org>:Fred Drake2000-09-231-0/+27
| | | | | | | Add three new convenience functions to the PyModule_*() family: PyModule_AddObject(), PyModule_AddIntConstant(), PyModule_AddStringConstant(). This closes SourceForge patch #101233.
* Special case the "s#" PyArg_Parse() token for Unicode objects:Marc-André Lemburg2000-09-211-26/+53
| | | | | | | | | | | | "s#" will now return a pointer to the default encoded string data of the Unicode object instead of a pointer to the raw UTF-16 data. The latter is still available via PyObject_AsReadBuffer(). The patch also adds an optimization for string objects which is based on the fact that string objects return the raw character data for getreadbuffer access and are always single-segment.
* On Unix, use O_EXCL when creating the .pyc/.pyo files, to avoid a race conditionGuido van Rossum2000-09-201-1/+31
|
* This patch adds a new Python C API called PyString_AsStringAndSize()Marc-André Lemburg2000-09-192-12/+7
| | | | | | | | | | | | | which implements the automatic conversion from Unicode to a string object using the default encoding. The new API is then put to use to have eval() and exec accept Unicode objects as code parameter. This closes bugs #110924 and #113890. As side-effect, the traditional C APIs PyString_Size() and PyString_AsString() will also accept Unicode objects as parameters.