summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Patch by Just van Rossum that changes how we search for submodules ofGuido van Rossum1998-08-111-19/+20
| | | | | | | frozen packages. (I *think* this means that we can now have a built-in module bar that's a submodule of a frozen package foo, by registering the built-in module with a name "foo.bar" in the table of builtin modules.)
* # Fix strange type (methonname instead of methodname).Guido van Rossum1998-08-081-4/+4
|
* Added declarations for Mac code resource modules (Jack Jansen).Guido van Rossum1998-08-061-1/+2
|
* Added handling for Mac code resource modules (Jack Jansen).Guido van Rossum1998-08-061-0/+10
|
* Gack. The module doc string is too long for VC++ 5.0.Guido van Rossum1998-08-061-2/+5
| | | | | However two string literals concatenated are fine! Hope this doesn't break other platforms.
* Make getversion.o dependent on ../Include/patchlevel.h as well.Fred Drake1998-08-051-1/+1
|
* Changes for BeOS, QNX and long long, by Chris Herborth.Guido van Rossum1998-08-047-1/+331
|
* In BUILD_LIST, use PyList_SET_ITEM() instead of PyList_SetItem(); andGuido van Rossum1998-08-041-3/+1
| | | | get rid of redundant error check.
* PyErr_SetFromErrnoWithFilename(): New function which supports settingBarry Warsaw1998-07-231-2/+14
| | | | | | | | | | | an exception from errno, with a supplied filename (primarily used by IOError and OSError). If class exceptions are used then the exception is instantiated with a 3-tuple: (errno, strerror, filename). For backwards compatibility reasons, if string exceptions are used, filename is ignored. PyErr_SetFromErrno(): Implement in terms of PyErr_SetFromErrnoWithFilename().
* Added support for two new standard errors: EnvironmentError andBarry Warsaw1998-07-231-5/+16
| | | | | | | | | OSError. The EnvironmentError serves primarily as the (common implementation) base class for IOError and OSError. OSError is used by posixmodule.c Also added tuple definition of EnvironmentError when using string based exceptions.
* Small changes to map() and filter():Guido van Rossum1998-07-101-5/+8
| | | | | | | (1) If a sequence S is shorter than len(S) indicated, don't fail -- just use the shorter size. (I.e, len(S) is just a hint.) (2) Implement the special case map(None, S) as list(S) -- it's faster.
* # In case BINARY_SUBSCR, use proper PyList_GET* macros instead of inlining.Guido van Rossum1998-07-081-3/+3
|
* Marc-Andre Lemburg's patch to support instance methods with otherGuido van Rossum1998-07-081-0/+5
| | | | callable objects than regular Pythonm functions as their im_func.
* Reindented some OS/2 and hpux code that looked ugly or at leastGuido van Rossum1998-07-081-29/+28
| | | | inconsistent.
* Two error messages still used the old name of the functio mkvalue() --Guido van Rossum1998-07-071-2/+2
| | | | which is now Py_BuildValue().
* Sigh. The hack to enable special treatment for errno on SGI machinesGuido van Rossum1998-07-071-0/+4
| | | | | | | | | must be enabled here, otherwise the errno we set on overflows is not the errno that's being read by compile.c. Wonder how many other files that do their own "#include config.h" need this too :-( (Because of the structure of autoconf, it's not so simple to get this into config.h...)
* Fix two smal memory leaks discovered by Vadim Chugunov.Guido van Rossum1998-07-011-3/+2
|
* Fix a stupid little bug: len() of an unsized returns -1 and leaves anGuido van Rossum1998-06-291-1/+5
| | | | exception waiting to happen next...
* Experimental feature: add default argument to getattr().Guido van Rossum1998-06-291-5/+13
|
* Windows-specific hack to make sure that when LoadLibrary() is called,Guido van Rossum1998-06-271-0/+22
| | | | | | the filename contains at least a rudimentary pathname. (The bad part is that we need to call getcwd() because only a prefix of ".\\" is not enough -- we prefix the drive letter.)
* Added doc strings. Maybe the doc string for the module itself is a bitGuido van Rossum1998-06-271-7/+102
| | | | long, but it sure helps!
* Added doc strings.Guido van Rossum1998-06-261-52/+432
|
* In raw_input(prompt), make sure that str(prompt) really a stringGuido van Rossum1998-06-261-0/+2
| | | | object before using it.
* Ignore Windows case check for ALL CAPS 8.3 filesGuido van Rossum1998-06-241-1/+39
|
* When unmarshalling, add test for negative lengths on strings, tuplesGuido van Rossum1998-06-081-2/+14
| | | | | | and lists; if the size is negative, raise an exception. Also raise an exception when an undefined type is found -- all this to increase the chance that garbage input causes an exception instead of a core dump.
* Remove a few unused locals (I love VC++ for this!).Guido van Rossum1998-05-291-2/+0
|
* Moved cmp_member() to abstract.c, as PySequence_Contains() [withGuido van Rossum1998-05-221-53/+2
| | | | | | | | swapped arguments]. Also make sure that no use of a function pointer gotten from a tp_as_sequence or tp_as_mapping structure is made without checking it for NULL first.
* A bunch of functions are now properly implemented in abstract.c, andGuido van Rossum1998-05-221-356/+40
| | | | | | | | | | | the code here becomes much simpler. In particular: abs(), divmod(), pow(), int(), long(), float(), len(), tuple(), list(). Also make sure that no use of a function pointer gotten from a tp_as_sequence or tp_as_mapping structure is made without checking it for NULL first. A few other cosmetic things, such as properly reindenting slice().
* Trivial little change: when setting a member to an object, hold theGuido van Rossum1998-05-201-1/+3
| | | | | | | old value in a temporary and XDECREF it only after then new value has been set. This prevents the (unlikely) case where the destructor of the member uses the containing object -- it would find it in an undefined state.
* Fix a curious bug: statements like "import sys.time" would succeed,Guido van Rossum1998-05-191-3/+10
| | | | | | because the path through the code would notice that sys.__path__ did not exist and it would fall back to the default path (builtins + sys.path) instead of failing). No longer.
* Remove use of RTLD_GLOBAL.Guido van Rossum1998-05-181-6/+4
|
* Another veeeeeery old patch...Guido van Rossum1998-05-151-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Date: Thu, 14 Sep 1995 12:18:20 -0400 From: Alan Morse <alan@dvcorp.com> To: python-list@cwi.nl Subject: getargs bug in 1.2 and 1.3 BETA We have found a bug in the part of the getargs code that we added and submitted, and which was incorporated into 1.1. The parsing of "O?" format specifiers is not handled correctly; there is no "else" for the "if" and therefore it can never fail. What's worse, the advancing of the varargs pointer is not handled properly, so from then on it is out of sync, wreaking all sorts of havoc. (If it had failed properly, then the out-of-sync varargs would not have been an issue.) Below is the context diff for the change. Note that I have made a few stylistic changes beyond adding the else case, namely: 1) Making the "O" case follow the convention established by the other format specifiers of getting all their vararg arguments before performing the test, rather than getting some before and some after the test passes. 2) Making the logic of the tests parallel, so the "if" part indicates that the format is accepted and the "else" part indicates that the format has failed. They were inconsistent with each other and with the the other format specifiers. -Alan Morse (amorse@dvcorp.com)
* In debug mode on MS Windows, DLLs are called foo_d.pyd or foo_d.dll.Guido van Rossum1998-05-151-0/+5
|
* Improved version of patch for HPUX from David Arnold.Guido van Rossum1998-05-141-4/+1
|
* New APIs for embedding applications that want to add their own entriesGuido van Rossum1998-05-141-0/+58
| | | | | | | | | | | to the table of built-in modules. This should normally be called *before* Py_Initialize(). When the malloc() or realloc() call fails, -1 is returned and the existing table is unchanged. After a similar function by Just van Rossum. int PyImport_ExtendInittab(struct _inittab *newtab); int PyImport_AppendInittab(char *name, void (*initfunc)());
* Remove unnecessary PyErr_Clear().Guido van Rossum1998-05-141-1/+0
|
* Since PyDict_GetItem() can't raise an exception any more, there's noGuido van Rossum1998-05-142-4/+0
| | | | need to call PyErr_Clear() when it returns NULL.
* DELETE_FAST should issue an exception when the local variable is undefined.Guido van Rossum1998-05-121-0/+7
|
* New APIs to write to sys.stdout or sys.stderr using a printf-like interface.Guido van Rossum1998-05-121-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | Adapted from code submitted by Just van Rossum. PySys_WriteStdout(format, ...) PySys_WriteStderr(format, ...) The first function writes to sys.stdout; the second to sys.stderr. When there is a problem, they write to the real (C level) stdout or stderr; no exceptions are raised (but a pending exception may be cleared when a new exception is caught). Both take a printf-style format string as their first argument followed by a variable length argument list determined by the format string. *** WARNING *** The format should limit the total size of the formatted output string to 1000 bytes. In particular, this means that no unrestricted "%s" formats should occur; these should be limited using "%.<N>s where <N> is a decimal number calculated so that <N> plus the maximum size of other formatted text does not exceed 1000 bytes. Also watch out for "%f", which can print hundreds of digits for very large numbers.
* Implement round() slightly different, so that for negative ndigits noGuido van Rossum1998-05-091-5/+13
| | | | | additional errors happen in the last step. The trick is to avoid division by 0.1**n -- multiply by 10.0**n instead.
* Support HPUX 10.20 DCE threads.Guido van Rossum1998-05-071-0/+6
|
* Fred's right -- we need PyList_SET_ITEM().Guido van Rossum1998-04-241-1/+1
|
* In-line the code in range() to set the list items; there's really noGuido van Rossum1998-04-231-1/+1
| | | | | need to call PyList_SetItem(v,i,w) when PyList_GET_ITEM(v,i)=w {sic} will do.
* Support for OpenBSD :-(Guido van Rossum1998-04-131-1/+1
|
* Reject empty module names -- otherwise __import__("") does somethingGuido van Rossum1998-04-111-0/+5
| | | | weird!
* Move #include <sys/param.h> to before osdefs.h (Donn Cave).Guido van Rossum1998-04-101-4/+5
|
* Comment out a label on an #endif.Guido van Rossum1998-04-101-1/+1
|
* Make new gcc -Wall happyGuido van Rossum1998-04-105-9/+16
|
* Address warnings issued by the MSVC++ compilerGuido van Rossum1998-04-102-2/+2
|
* /* An extension mechanism to store arbitrary additional per-thread state.Guido van Rossum1998-04-101-0/+21
| | | | | | | | | | PyThreadState_GetDict() returns a dictionary that can be used to hold such state; the caller should pick a unique key and store its state there. If PyThreadState_GetDict() returns NULL, an exception has been raised (most likely MemoryError) and the caller should pass on the exception. */ PyObject * PyThreadState_GetDict()