summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix reload() for package submodules.Guido van Rossum1997-09-061-2/+24
|
* Phase two of package import. "import a.b.c" and all variants now do theGuido van Rossum1997-09-061-17/+299
| | | | | | | | | | | | | | | right thing. Still to do: - Make reload() of a submodule work. - Performance tweaks -- currently, a submodule that tries to import a global module *always* searches the package directory first, even if the global module was already imported. Not sure how to solve this one; probably need to record misses per package. - Documentation!
* #Added prototype for PyObject_HasAttr() -- must've been an oversight.Guido van Rossum1997-09-061-0/+1
|
* Test set for package import.Guido van Rossum1997-09-062-0/+212
|
* Fixed some details of printing the str() of an exception. This fixesGuido van Rossum1997-09-051-2/+6
| | | | | a core dump when __str__() returns a non-string, and plugs a memory leak as well: the result of PyObject_Str() was never DECREFed.
* Made the 'info' argument to SyntaxError optional, so phase-2 syntaxGuido van Rossum1997-09-051-8/+11
| | | | | | | | | errors are handled (these gave ``TypeError: not enough arguments''). Also changed its __str__() to correct a typo (missing self.) and return str(self.msg) to ensure the result is always string. Also changed the default __str__ to simply return str(self.args).
* Fix in trailing comment: PyDict_SetItemString() does *not* consume a referenceFred Drake1997-09-051-3/+2
| | | | count, PyList_SetItem() does. Very confusing!
* First part of package support.Guido van Rossum1997-09-055-148/+460
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't yet support "import a.b.c" or "from a.b.c import x", but it does recognize directories. When importing a directory, it initializes __path__ to a list containing the directory name, and loads the __init__ module if found. The (internal) find_module() and load_module() functions are restructured so that they both also handle built-in and frozen modules and Mac resources (and directories of course). The imp module's find_module() and (new) load_module() also have this functionality. Moreover, imp unconditionally defines constants for all module types, and has two more new functions: find_module_in_package() and find_module_in_directory(). There's also a new API function, PyImport_ImportModuleEx(), which takes all four __import__ arguments (name, globals, locals, fromlist). The last three may be NULL. This is currently the same as PyImport_ImportModule() but in the future it will be able to do relative dotted-path imports. Other changes: - bltinmodule.c: in __import__, call PyImport_ImportModuleEx(). - ceval.c: always pass the fromlist to __import__, even if it is a C function, so PyImport_ImportModuleEx() is useful. - getmtime.c: the function has a second argument, the FILE*, on which it applies fstat(). According to Sjoerd this is much faster. The first (pathname) argument is ignored, but remains for backward compatibility (so the Mac version still works without changes). By cleverly combining the new imp functionality, the full support for dotted names in Python (mini.py, not checked in) is now about 7K, lavishly commented (vs. 14K for ni plus 11K for ihooks, also lavishly commented). Good night!
* Added PyImport_ImportModuleEx(name, globals, locals, fromlist); thisGuido van Rossum1997-09-052-0/+4
| | | | | | is like PyImport_ImporModule(name) but receives the globals and locals dict and the fromlist arguments as well. (The name is a char*; the others are PyObject*s).
* Contribution by Hannu Krosing (with some changes).Guido van Rossum1997-09-051-0/+38
| | | | | | | Added 'p' format character for Pascal string (i.e. leading length byte). This uses the count prefix line 's' does, except that the count includes the length byte; i.e. '10p' takes 10 bytes packed but has space for a length byte and 9 data bytes.
* Don't use ANSI string literal concatenation (everything is K&R compatible).Guido van Rossum1997-09-051-4/+4
|
* Get rid of most silly #include and #ifdefs near the top; these are allGuido van Rossum1997-09-051-55/+59
| | | | | | obsolete now it includes Python.h. Make all functions K&R compatible (Sue Williams).
* Now produces some reassuring output.Jeremy Hylton1997-09-041-0/+9
|
* Many more tests, including tests of many optional arguments.Jeremy Hylton1997-09-041-0/+47
|
* Several changes:Jeremy Hylton1997-09-041-125/+188
| | | | | | | | | | | | | | | | | 1. Fix bug in (de)compression objects. The final string resize used zst.total_out to determine the length of the string, but the (de)compression object will output data a little bit at a time, which means total_out is not the string size. Fix: save original value of total_out at the start of the call. 2. Be sure to Py_DECREF the result value if you exit with an exception. 3. Use PyInt_FromLong instead of Py_BuildValue 4. include more constants from the zlib header file 5. Use PyErr_Format instead of using a local buffer and sprintf.
* Added some try-excepts so that it can be imported in restricted modeGuido van Rossum1997-09-041-6/+15
| | | | | | (though some type names are undefined in that case, e.g. CodeType (inaccessible), FileType (not always accessible), and TracebackType and FrameType (inaccessible).
* The re test suite is very slow on slower hosts.Guido van Rossum1997-09-041-0/+3
| | | | To save time, only run the first and last 10 tests except in verbose mode.
* Added first line to set Emacs makefile mode (pretty colors :-)Barry Warsaw1997-09-041-0/+1
|
* (py-parse-partial-sexp-works-p): Removed as obsolete. All currentBarry Warsaw1997-09-041-20/+10
| | | | | | Emacs and XEmacs versions should have working parse-partial-sexp's. (py-emacs-features): Defined as future placeholder.
* Different test for Unix -- rely on os.sep instead of sys.platform.Guido van Rossum1997-09-031-3/+3
|
* One patch from Sjoerd and one from Jack.Guido van Rossum1997-09-031-7/+14
| | | | | | | | | | | Sjoerd: add separate administration of temporary files created y URLopener.retrieve() so cleanup can properly remove them. The old code removed everything in tempcache which was a bad idea if the user had passed a non-temp file into it. (I added a line to delete the tempcache in cleanup() -- it still seems to make sense.) Jack: in basejoin(), interpret relative paths starting in "../". This is necessary if the server uses symbolic links.
* Give in to Mike Meyer -- add *both* lib/python1.5/packages andGuido van Rossum1997-09-032-18/+40
| | | | | lib/site-python to the path (if they exist). This is a reasonable compromise.
* Give in to Mike Meyer -- add *both* lib/python1.5/packages andGuido van Rossum1997-09-031-7/+9
| | | | | lib/site-python to the path (if they exist). This is a reasonable compromise.
* #Plug small memory leaks in constructors.Guido van Rossum1997-09-033-6/+15
|
* Plug small leaks: the [de]compress object itself was never freed.Guido van Rossum1997-09-031-0/+2
|
* Added some symbols (I'm afraid more will come).Guido van Rossum1997-09-031-0/+3
|
* Change instructions to require use of PCbuild directory (instead ofGuido van Rossum1997-09-031-12/+7
| | | | just recommending it). At Mark Hammond's request.
* At Mark Hammond's suggestion:Guido van Rossum1997-09-035-17/+125
| | | | | | | - use the DLL versions of the C runtime (!) - change path settings so intermediate files go to Debug/temp or Release/temp - add resource file to python15.dll (can't remember what this does) - add a separate project to build the parser module
* Added empty PCbuild directory for use by the NT build process.Guido van Rossum1997-09-031-0/+5
|
* Added new flags and exceptions; removed AccessError exception.Guido van Rossum1997-09-031-1/+5
|
* Change [_Py_]re_compile_pattern() to return a char*.Guido van Rossum1997-09-033-12/+12
| | | | | Since it only returns an error message (or NULL) there's no reason for it to be unsigned char *, and various compilers like this better.
* Mod suggested by Donn Cave -- invoke makexp_aix relative to $0Guido van Rossum1997-09-031-2/+4
| | | | so it doesn't have to be on $PATH.
* Disable the portable multimedia modules (audioop, imageop, rgbimg) byGuido van Rossum1997-09-031-4/+5
| | | | default since they don't work on 64-bit platforms.
* #Removed debug print that was accidentally left in.Guido van Rossum1997-09-031-2/+0
|
* Add the same _keep_alive patch (by Michael Scharff) that was added toGuido van Rossum1997-09-031-0/+19
| | | | | copy.deepcopy() a while ago. Can't reproduce this but it doesn't break anything and it looks like the code could have the same problem.
* Fix the bug Jeremy was experiencing: both the close() and theGuido van Rossum1997-09-031-4/+19
| | | | | | | | | | | dealloc() functions contained code to free/DECREF the buffer (there were differences between I and O objects but the logic bug was the same). Fixed this be setting the buffer pointer to NULL and testing for that. (This also makes it safe to call close() more than once.) XXX Worry: what if you try to read() or write() once the thing is closed?
* Define BUILDNO in macbuildno.h (incremented by fullbuild)Jack Jansen1997-09-012-0/+3
|
* Can't remember...Jack Jansen1997-09-011-13/+2
|
* Added GetTicks() here, so profiling can use a decent timerJack Jansen1997-09-011-0/+9
|
* Fullbuild now maintains BUILDNO for mac buildsJack Jansen1997-09-012-15/+35
|
* Names changedJack Jansen1997-09-012-38/+38
|
* #typoGuido van Rossum1997-08-301-1/+1
|
* Document newly revamped site configuration mechanism.Guido van Rossum1997-08-302-38/+126
| | | | Damn the criticism in c.l.p!
* Added docs for 'user' customization module. Renamed libuser.texGuido van Rossum1997-08-305-3/+126
| | | | (which had UserDict/UserList) to libuserdict.tex.
* Inline PyObject_CallObject (Marc-Andre Lemburg).Guido van Rossum1997-08-302-1/+9
|
* Added os.altsep; this is '/' on DOS/Windows, and None on systems withGuido van Rossum1997-08-292-4/+16
| | | | a sane filename syntax.
* Write out the dynamic OS choice, to avoid exec statements.Guido van Rossum1997-08-291-51/+66
| | | | | Adding support for a new OS is now a bit more work, but I bet that 'dos' or 'nt' will cover most situations...
* Added -X option to suppress default import of site.py. Also split theGuido van Rossum1997-08-291-5/+13
| | | | | usage message in *three* parts under 510 bytes, for low-end ANSI compatibility.
* Added NoSite flag.Guido van Rossum1997-08-291-0/+1
|
* Two independent changes (oops):Guido van Rossum1997-08-291-4/+35
| | | | | | | | | - Changed semantics for initialized flag (again); forget the ref counting, forget the fatal errors -- redundant calls to Py_Initialize() or Py_Finalize() calls are simply ignored. - Automatically import site.py on initialization, unless a flag is set not to do this by main().