]> granicus.if.org Git - python/log
python
27 years agoThe usual
Guido van Rossum [Thu, 14 Aug 1997 19:45:07 +0000 (19:45 +0000)]
The usual

27 years agoDon't call sys.exit() all over the place -- simply return the exit
Guido van Rossum [Thu, 14 Aug 1997 19:40:34 +0000 (19:40 +0000)]
Don't call sys.exit() all over the place -- simply return the exit
status from main() and call sys.exit(main()) in the startup stub at
the end of the file.

27 years agoComment out use of reop.expand_escape and reop._expand until their
Guido van Rossum [Thu, 14 Aug 1997 19:33:06 +0000 (19:33 +0000)]
Comment out use of reop.expand_escape and reop._expand until their
bugginess has been fixed.

27 years agoUse _Py_re_match/search instead of re_match/search; these may become
Guido van Rossum [Thu, 14 Aug 1997 14:35:12 +0000 (14:35 +0000)]
Use _Py_re_match/search instead of re_match/search; these may become
different in a future version.

27 years agoFred Lundh's latest versions.
Guido van Rossum [Thu, 14 Aug 1997 14:17:28 +0000 (14:17 +0000)]
Fred Lundh's latest versions.

27 years agoAdd dummies for create/delete filehandles, just so that vanilla Grail
Guido van Rossum [Thu, 14 Aug 1997 14:15:54 +0000 (14:15 +0000)]
Add dummies for create/delete filehandles, just so that vanilla Grail
0.3 won't break on Windows.

27 years agoDocumented mime_decode_header() and mime_encode_header().
Guido van Rossum [Thu, 14 Aug 1997 14:13:01 +0000 (14:13 +0000)]
Documented mime_decode_header() and mime_encode_header().

27 years agoFixed (and documented, see Doc/libmimify.tex) mime_decode_header() and
Guido van Rossum [Thu, 14 Aug 1997 14:10:37 +0000 (14:10 +0000)]
Fixed (and documented, see Doc/libmimify.tex) mime_decode_header() and
mime_encode_header().

27 years agoAdded Windows NT instructions.
Guido van Rossum [Thu, 14 Aug 1997 02:12:04 +0000 (02:12 +0000)]
Added Windows NT instructions.

27 years agoChanges for building under windows.
Guido van Rossum [Thu, 14 Aug 1997 01:45:33 +0000 (01:45 +0000)]
Changes for building under windows.

27 years agoMany changes.
Jeremy Hylton [Wed, 13 Aug 1997 23:19:55 +0000 (23:19 +0000)]
Many changes.

Change default alloc size for uncompressing to 16K.

Remove comment about core dumps when an invalid window sizes is used.
This bug has been fixed in zlib 1.0.4.

Two new optional arguments to decompress, wbits and bufsize.  wbits
specifies the window size and bufsize specifies the initial output
string size.

In decompression code -- decompress and decompressobj methods -- use a
Python string (and _PyString_Resize) to collect the uncompressed
stream.  Replaces a separate buffer that was copied into a string.

Fix bug in decompress that caused it to always realloc the buffer when
it was finished decompressing.

Modernized handling of optional arguments to compressobj.

Updated doc strings.

27 years agoProbably the last VC++ 4.2 makefile I'll check in.
Guido van Rossum [Wed, 13 Aug 1997 23:08:39 +0000 (23:08 +0000)]
Probably the last VC++ 4.2 makefile I'll check in.
After this I will be using 5.0, which has binary workspace files...

27 years agoSmall changes to readme and makefile; tested for 1.5a3!
Guido van Rossum [Wed, 13 Aug 1997 23:07:44 +0000 (23:07 +0000)]
Small changes to readme and makefile; tested for 1.5a3!

27 years ago1.5a3 prerelease 1 from AMK
Guido van Rossum [Wed, 13 Aug 1997 22:34:14 +0000 (22:34 +0000)]
1.5a3 prerelease 1 from AMK

27 years agoMust update the available space in the output buffer after
Jeremy Hylton [Wed, 13 Aug 1997 21:39:18 +0000 (21:39 +0000)]
Must update the available space in the output buffer after
realloc. (Fixed in PyZlib_unflush.)

27 years agoremoved getpath_nt.c in favor of revamped getpathp.c
Guido van Rossum [Wed, 13 Aug 1997 21:38:04 +0000 (21:38 +0000)]
removed getpath_nt.c in favor of revamped getpathp.c

27 years agoMuch rewritten. Added Win32 registry stuff (from getpath_nt.c, which
Guido van Rossum [Wed, 13 Aug 1997 21:30:44 +0000 (21:30 +0000)]
Much rewritten.  Added Win32 registry stuff (from getpath_nt.c, which
is now obsolete), and changed the default path calculations.
$PYTHONPATH is now added as a prefix (like it's always been on Unix);
$PYTHONHOME takes precedence over the program pathname; and only one
landmark is needed.

27 years agoMade it real. Changed locking() to work with file descriptors instead
Guido van Rossum [Wed, 13 Aug 1997 19:57:53 +0000 (19:57 +0000)]
Made it real.  Changed locking() to work with file descriptors instead
of Python file objects.  Added open_osfhandle() (Mark had done some
work for that), get_osfhandle(), setmode(), and the console I/O
functions kbhit(), getch(), getche(), ungetch(), and putch().

27 years agoSome changes to make it work on NT; add the directory where the binary
Guido van Rossum [Wed, 13 Aug 1997 19:55:43 +0000 (19:55 +0000)]
Some changes to make it work on NT; add the directory where the binary
lives to the end of the path.

(Still to do: add $PYTHONPATH to the front instead of using it as is;
add the Win32 registry paths as in getpath_nt.c (which can then
retire).)

27 years agoMoved PyWin_IsWin32s() here.
Guido van Rossum [Wed, 13 Aug 1997 19:53:11 +0000 (19:53 +0000)]
Moved PyWin_IsWin32s() here.

27 years agoRemove #define main; remove vc40 from PYTHONPATH.
Guido van Rossum [Wed, 13 Aug 1997 19:52:26 +0000 (19:52 +0000)]
Remove #define main; remove vc40 from PYTHONPATH.

27 years agoFix bug with \< (AMK).
Guido van Rossum [Wed, 13 Aug 1997 16:35:04 +0000 (16:35 +0000)]
Fix bug with \< (AMK).

27 years agoAdd try-finally to close the file after loading it in
Guido van Rossum [Wed, 13 Aug 1997 14:48:36 +0000 (14:48 +0000)]
Add try-finally to close the file after loading it in
ModuleLoader.load_module!  (Thanks to Daniel Larsson who complained
about this.)

27 years agoVarious changes by AMK, e.g. remove \e, \cX, add \v
Guido van Rossum [Wed, 13 Aug 1997 03:25:34 +0000 (03:25 +0000)]
Various changes by AMK, e.g. remove \e, \cX, add \v

27 years agoChanges by AMK:
Guido van Rossum [Wed, 13 Aug 1997 03:24:53 +0000 (03:24 +0000)]
Changes by AMK:

Removed handling of \e, \cX escapes, following a string-SIG discussion.

Fixed minor typos in re.py
re.error is now set equal to reop.error.
Move definition of constants like NORMAL and CHARCLASS into reop, which
  exports them; re.py was changed to import them from reop.
Added C equivalents of _expand and expand_escape to reop, and changed
  re.py to use them.

27 years agoAdd syntax for hex,octal
Guido van Rossum [Wed, 13 Aug 1997 03:21:14 +0000 (03:21 +0000)]
Add syntax for hex,octal

27 years agocPickle release 0.3 from Jim Fulton
Guido van Rossum [Wed, 13 Aug 1997 03:14:41 +0000 (03:14 +0000)]
cPickle release 0.3 from Jim Fulton

27 years agoNew dialog from Fred Lundh
Guido van Rossum [Tue, 12 Aug 1997 18:21:21 +0000 (18:21 +0000)]
New dialog from Fred Lundh

27 years agoFixes for the Mac. (Jack)
Guido van Rossum [Tue, 12 Aug 1997 18:21:08 +0000 (18:21 +0000)]
Fixes for the Mac. (Jack)

27 years agoChanges suggested by Jim fulton:
Guido van Rossum [Tue, 12 Aug 1997 18:18:13 +0000 (18:18 +0000)]
Changes suggested by Jim fulton:
- Moved most imports to the top, for faster loadingf when using ni.
- Always open the temp file in binary mode.

27 years agoAdded TemporaryFile and wrapper class by Jim Fulton.
Guido van Rossum [Tue, 12 Aug 1997 18:00:12 +0000 (18:00 +0000)]
Added TemporaryFile and wrapper class by Jim Fulton.
Look in more env vars (for NT: TEMP, TMP).

27 years agoAdded decls for stuff from myreadline.
Guido van Rossum [Tue, 12 Aug 1997 15:14:22 +0000 (15:14 +0000)]
Added decls for stuff from myreadline.

27 years agoMegapatch for IRIX 6 by Sjoerd.
Guido van Rossum [Tue, 12 Aug 1997 14:58:54 +0000 (14:58 +0000)]
Megapatch for IRIX 6 by Sjoerd.

27 years agoAdded prototype for various finalizers.
Guido van Rossum [Tue, 12 Aug 1997 14:57:21 +0000 (14:57 +0000)]
Added prototype for various finalizers.

27 years agoAdded prototype for PyGrammar_RemoveAccelerators().
Guido van Rossum [Tue, 12 Aug 1997 14:57:08 +0000 (14:57 +0000)]
Added prototype for PyGrammar_RemoveAccelerators().

27 years agoAdded buffer_info() method that returns address and length in bytes of
Guido van Rossum [Tue, 12 Aug 1997 14:55:56 +0000 (14:55 +0000)]
Added buffer_info() method that returns address and length in bytes of
the buffer used to hold the array -- for dangerous low-level I/O.

27 years agoFix mixup about PyErr_NoMemory() prototype.
Guido van Rossum [Tue, 12 Aug 1997 14:54:54 +0000 (14:54 +0000)]
Fix mixup about PyErr_NoMemory() prototype.

27 years agoUse string interning and caching to get speedups on the mac (Jack).
Guido van Rossum [Tue, 12 Aug 1997 14:53:39 +0000 (14:53 +0000)]
Use string interning and caching to get speedups on the mac (Jack).

27 years agoUse strerror on the mac if using MSL (Jack).
Guido van Rossum [Tue, 12 Aug 1997 14:51:52 +0000 (14:51 +0000)]
Use strerror on the mac if using MSL (Jack).

27 years agoBump MS_DLL_ID to 1.5.0.
Guido van Rossum [Tue, 12 Aug 1997 14:48:03 +0000 (14:48 +0000)]
Bump MS_DLL_ID to 1.5.0.

27 years agoAllow paths without drive specifier (Jack).
Guido van Rossum [Tue, 12 Aug 1997 14:47:24 +0000 (14:47 +0000)]
Allow paths without drive specifier (Jack).

27 years agoRewrite normcase() using string.translate...
Guido van Rossum [Tue, 12 Aug 1997 14:46:58 +0000 (14:46 +0000)]
Rewrite normcase() using string.translate...

27 years agoTreat all HTTP/1.* versions the same.
Guido van Rossum [Tue, 12 Aug 1997 14:46:13 +0000 (14:46 +0000)]
Treat all HTTP/1.* versions the same.

27 years agoTwo changes:
Guido van Rossum [Mon, 11 Aug 1997 21:52:17 +0000 (21:52 +0000)]
Two changes:

(1) No longer close self.sock; close it on close().  (Guido)

(2) Don't use regular expressions for what can be done simply with
string.split() -- regex is thread unsafe.  (Jeremy)

(3) Delete unused imports.  (Jeremy)

27 years agoRenamed Py_input_hook to PyOS_InputHook.
Guido van Rossum [Mon, 11 Aug 1997 18:57:29 +0000 (18:57 +0000)]
Renamed Py_input_hook to PyOS_InputHook.
Also cleaned out some CR's left by the VC++ editor.

27 years agoRewrite using class, to make waiting for processes possible;
Guido van Rossum [Mon, 11 Aug 1997 03:27:24 +0000 (03:27 +0000)]
Rewrite using class, to make waiting for processes possible;
by default children are waited for automatically.

27 years agoChanged indents to 4 *spaces*; added Emacs variables to avoid
Guido van Rossum [Sun, 10 Aug 1997 16:56:48 +0000 (16:56 +0000)]
Changed indents to 4 *spaces*; added Emacs variables to avoid
inserting tabs.  All this (and the previous patch) in preparation for
porting to NT.

27 years agoSupport using -p/-P to point to the source/build directory instead of
Guido van Rossum [Sun, 10 Aug 1997 16:47:17 +0000 (16:47 +0000)]
Support using -p/-P to point to the source/build directory instead of
the install directory.  Added -h option to print the full usage
message; by default, only two lines are now printed for errors.

27 years ago#Fixed two byte-compiler errors
Barry Warsaw [Sat, 9 Aug 1997 06:43:20 +0000 (06:43 +0000)]
#Fixed two byte-compiler errors

27 years ago#Checkpointing X/Emacs 20'fication of this mode.
Barry Warsaw [Sat, 9 Aug 1997 06:42:08 +0000 (06:42 +0000)]
#Checkpointing X/Emacs 20'fication of this mode.

27 years agoAdded O_BINARY and O_TEXT (for Windows).
Guido van Rossum [Fri, 8 Aug 1997 21:48:51 +0000 (21:48 +0000)]
Added O_BINARY and O_TEXT (for Windows).

27 years agoMore emphasis on os.environ's calling of putenv; and added hint about
Guido van Rossum [Fri, 8 Aug 1997 21:05:09 +0000 (21:05 +0000)]
More emphasis on os.environ's calling of putenv; and added hint about
flags for open().

27 years ago#Bumping to version 3.0
Barry Warsaw [Fri, 8 Aug 1997 16:19:03 +0000 (16:19 +0000)]
#Bumping to version 3.0

27 years agomkalias() now has an optional third parameter to create relative
Jack Jansen [Fri, 8 Aug 1997 15:00:59 +0000 (15:00 +0000)]
mkalias() now has an optional third parameter to create relative
aliases (Just)

27 years ago- Added classes to support class/property generation by gensuitemodule
Jack Jansen [Fri, 8 Aug 1997 15:00:03 +0000 (15:00 +0000)]
- Added classes to support class/property generation by gensuitemodule
- Fixed Property class: selector is a 'type', not an 'enum'

27 years agoAdded (dummy) PyOS_FiniInterrupts
Jack Jansen [Fri, 8 Aug 1997 14:57:37 +0000 (14:57 +0000)]
Added (dummy) PyOS_FiniInterrupts

27 years agoAdapted for 1.5a3: Py_SupressPrintingFlag is gone, and
Jack Jansen [Fri, 8 Aug 1997 14:56:41 +0000 (14:56 +0000)]
Adapted for 1.5a3: Py_SupressPrintingFlag is gone, and
Py_SetProgramName replaces Py_GetProgramName

27 years agoNew version number, new tk resources, new error numbers, new GUSI
Jack Jansen [Fri, 8 Aug 1997 14:55:03 +0000 (14:55 +0000)]
New version number, new tk resources, new error numbers, new GUSI

27 years agoDon't define ENOENT when compiling with MSL
Jack Jansen [Fri, 8 Aug 1997 14:53:16 +0000 (14:53 +0000)]
Don't define ENOENT when compiling with MSL

27 years agoCW11 projects replaced by CW Pro 1 projects, and all cfm68k/ppc
Jack Jansen [Fri, 8 Aug 1997 14:51:57 +0000 (14:51 +0000)]
CW11 projects replaced by CW Pro 1 projects, and all cfm68k/ppc
projects unified (as much as possible: PythonCore is still separate).

27 years agoModified for CW Pro 1 projects. Convention used: .mu files are old
Jack Jansen [Fri, 8 Aug 1997 14:51:54 +0000 (14:51 +0000)]
Modified for CW Pro 1 projects. Convention used: .mu files are old
project files, which have to be cleaned up before checking in, .prj
files are CW Pro 1 projects (which are always clean). Prj files are
still binhexed, even though they only have a data fork (and, hence,
could be checked in in binary mode).

27 years agoGenerate class, property and comparison code (finally!). The resulting
Jack Jansen [Fri, 8 Aug 1997 14:49:02 +0000 (14:49 +0000)]
Generate class, property and comparison code (finally!). The resulting
code isn't ideal yet: xxx.Window(1).Paragraph(3).font will only work
if all the classes and properties are declared in the same suite, but
at least font(Paragraph(3, Window(1))) always works.

27 years agoRemove unised variable
Guido van Rossum [Thu, 7 Aug 1997 19:22:48 +0000 (19:22 +0000)]
Remove unised variable

27 years agoRather unsatisfactory temporary hack to get it to run
Guido van Rossum [Thu, 7 Aug 1997 00:12:22 +0000 (00:12 +0000)]
Rather unsatisfactory temporary hack to get it to run
under WIN32 -- remove file handler interface, don't use Py_input_hook.

27 years agoGot the new structure working with MSVC 4.2.
Guido van Rossum [Thu, 7 Aug 1997 00:11:34 +0000 (00:11 +0000)]
Got the new structure working with MSVC 4.2.
main_nt.c is gone -- we can use Modules/python.c now.
Added Mark Hammond's module msvcrt.c (untested).
Added several new symbols.

27 years agoNew version of Vladimir Marangozov's AIX hacks -- simpler etc.
Guido van Rossum [Wed, 6 Aug 1997 23:42:07 +0000 (23:42 +0000)]
New version of Vladimir Marangozov's AIX hacks -- simpler etc.

27 years ago--with-readline is obsolete (and some editorial stuff in README)
Guido van Rossum [Tue, 5 Aug 1997 21:50:20 +0000 (21:50 +0000)]
--with-readline is obsolete (and some editorial stuff in README)

27 years agoGot rid of --with-readline, at last.
Guido van Rossum [Tue, 5 Aug 1997 21:47:42 +0000 (21:47 +0000)]
Got rid of --with-readline, at last.

27 years agoAttempt to import readline at interactive startup.
Guido van Rossum [Tue, 5 Aug 1997 21:34:14 +0000 (21:34 +0000)]
Attempt to import readline at interactive startup.

27 years agoMove GNU readline interface to ../Modules/readline.c.
Guido van Rossum [Tue, 5 Aug 1997 21:28:12 +0000 (21:28 +0000)]
Move GNU readline interface to ../Modules/readline.c.
Add Py_input_hook (used by _tkinter and perhaps Gist).

27 years agoNew mechanism for GNU readline interface, via module
Guido van Rossum [Tue, 5 Aug 1997 21:27:50 +0000 (21:27 +0000)]
New mechanism for GNU readline interface, via module

27 years agoAdd test for function comparisons
Guido van Rossum [Tue, 5 Aug 1997 16:52:50 +0000 (16:52 +0000)]
Add test for function comparisons

27 years agoFix bug in comparing function objects detected by Sjoerd:
Guido van Rossum [Tue, 5 Aug 1997 16:51:05 +0000 (16:51 +0000)]
Fix bug in comparing function objects detected by Sjoerd:

SystemError: bad argument to internal function

caused by comparing NULL pointer default args.

27 years agoGet READABLE c.s. from _tkinter instead of conditional definition.
Guido van Rossum [Tue, 5 Aug 1997 02:35:01 +0000 (02:35 +0000)]
Get READABLE c.s. from _tkinter instead of conditional definition.

in Tk.destroy(), reset _default_root to None when it is us.

27 years agoAdd a cast to the call to _Py_Dealloc in the expanded version of
Guido van Rossum [Tue, 5 Aug 1997 02:30:44 +0000 (02:30 +0000)]
Add a cast to the call to _Py_Dealloc in the expanded version of
Py_DECREF, to reduce the warnings when compiling with reference count
debugging on.  (There are still warnings for each call to
_Py_NewReference -- too bad.)

27 years agoAdd pointer to new BSDDB module.
Guido van Rossum [Tue, 5 Aug 1997 02:25:24 +0000 (02:25 +0000)]
Add pointer to new BSDDB module.

27 years agopurported linux portability patch (Oliver Andrich)
Guido van Rossum [Tue, 5 Aug 1997 02:24:57 +0000 (02:24 +0000)]
purported linux portability patch (Oliver Andrich)

27 years agoPy_Cleanup() is now Py_Finalize().
Guido van Rossum [Tue, 5 Aug 1997 02:23:48 +0000 (02:23 +0000)]
Py_Cleanup() is now Py_Finalize().

27 years agoMerge Py_Cleanup() into Py_Finalize(). Call the various small Fini()
Guido van Rossum [Tue, 5 Aug 1997 02:22:03 +0000 (02:22 +0000)]
Merge Py_Cleanup() into Py_Finalize().  Call the various small Fini()
functions.

27 years agoNew rules for deleting modules. Rather than having an elaborate
Guido van Rossum [Tue, 5 Aug 1997 02:20:51 +0000 (02:20 +0000)]
New rules for deleting modules.  Rather than having an elaborate
scheme based on object's types, have a simple two-phase scheme based
on object's *names*:

/* To make the execution order of destructors for global
   objects a bit more predictable, we first zap all objects
   whose name starts with a single underscore, before we clear
   the entire dictionary.  We zap them by replacing them with
   None, rather than deleting them from the dictionary, to
   avoid rehashing the dictionary (to some extent). */

27 years agoRenamed a local label that was accidentally grandly renamed to
Guido van Rossum [Tue, 5 Aug 1997 02:18:01 +0000 (02:18 +0000)]
Renamed a local label that was accidentally grandly renamed to
'Py_Cleanup' back to 'cleanup'.

27 years agoAdded _Fini() routines to free up some memory
Guido van Rossum [Tue, 5 Aug 1997 02:16:08 +0000 (02:16 +0000)]
Added _Fini() routines to free up some memory

27 years agoChange the Fini function to only remove otherwise unreferenced strings
Guido van Rossum [Tue, 5 Aug 1997 02:15:12 +0000 (02:15 +0000)]
Change the Fini function to only remove otherwise unreferenced strings
from the interned table.  There are references in hard-to-find static
variables all over the interpreter, and it's not worth trying to get
rid of all those; but "uninterning" isn't fair either and may cause
subtle failures later -- so we have to keep them in the interned
table.

Also get rid of no-longer-needed insert of None in interned dict.

27 years agoAdded separate free list for cfunction (builtin method) objects, for a
Guido van Rossum [Tue, 5 Aug 1997 02:11:41 +0000 (02:11 +0000)]
Added separate free list for cfunction (builtin method) objects, for a
few percent speed up.  Also add PyCFunction_Fini() to discard it.

27 years agoProvide a dummy empty directory as f_builtins instead of failing, when
Guido van Rossum [Tue, 5 Aug 1997 02:09:46 +0000 (02:09 +0000)]
Provide a dummy empty directory as f_builtins instead of failing, when
no valid directory is passed in.  This prevents __del__ to fail when
invoked after __builtins__ has already been discarded.

Also add PyFrame_Fini() to discard the cache of frames.

27 years agoAdded separate free list for instance method objects, for a few
Guido van Rossum [Tue, 5 Aug 1997 02:06:53 +0000 (02:06 +0000)]
Added separate free list for instance method objects, for a few
percent speed up.  Also add PyMethod_Fini() to discard it.

27 years agoAdded _Py_ResetReferences(), if tracing references.
Guido van Rossum [Tue, 5 Aug 1997 02:04:34 +0000 (02:04 +0000)]
Added _Py_ResetReferences(), if tracing references.
In _Py_PrintReferences(), no longer suppress once-referenced string.

Add Py_Malloc and friends and PyMem_Malloc and friends (malloc
wrappers for third parties).

27 years agoAdded Py_Malloc and friends as well as PyMem_Malloc and friends.
Guido van Rossum [Tue, 5 Aug 1997 01:59:22 +0000 (01:59 +0000)]
Added Py_Malloc and friends as well as PyMem_Malloc and friends.

27 years agoPlug memory leak (DECREF doc string properly after inserting in dict).
Guido van Rossum [Mon, 4 Aug 1997 23:55:25 +0000 (23:55 +0000)]
Plug memory leak (DECREF doc string properly after inserting in dict).

27 years agoThe reload(sys) test no longer works due to changes in the import
Guido van Rossum [Sat, 2 Aug 1997 03:19:26 +0000 (03:19 +0000)]
The reload(sys) test no longer works due to changes in the import
semantics.

27 years agoOops, one more checkin. Use the new tstate/interp interface.
Guido van Rossum [Sat, 2 Aug 1997 03:13:11 +0000 (03:13 +0000)]
Oops, one more checkin.  Use the new tstate/interp interface.

27 years agoThe last of the mass checkins for separate (sub)interpreters.
Guido van Rossum [Sat, 2 Aug 1997 03:10:38 +0000 (03:10 +0000)]
The last of the mass checkins for separate (sub)interpreters.
Everything should now work again.

See the comments for the .h files mass checkin (e.g. pystate.h) for
more detail.

27 years agoRemoved fatal errors from Py_Initmodule4() (and thus from
Guido van Rossum [Sat, 2 Aug 1997 03:07:46 +0000 (03:07 +0000)]
Removed fatal errors from Py_Initmodule4() (and thus from
Py_Initmodule(), which is a macro wrapper around it).

The return value is now a NULL pointer if the initialization failed.
This may make old modules fail with a SEGFAULT, since they don't
expect this kind of failure.  That's OK, since (a) it "never" happens,
and (b) they would fail with a fatal error otherwise, anyway.

Tons of extension modules should now check the return value of
Py_Initmodule*() -- that's on my TODO list.

27 years agoAdded finalization routines.
Guido van Rossum [Sat, 2 Aug 1997 03:02:27 +0000 (03:02 +0000)]
Added finalization routines.

27 years agoAdd finialization routines; fixed some memory leaks related to this.
Guido van Rossum [Sat, 2 Aug 1997 03:01:42 +0000 (03:01 +0000)]
Add finialization routines; fixed some memory leaks related to this.

Reset the SIGINT handler when the finalization is invoked.

27 years agoFree the malloc'ed buffer that holds the command once we're done with it.
Guido van Rossum [Sat, 2 Aug 1997 03:00:42 +0000 (03:00 +0000)]
Free the malloc'ed buffer that holds the command once we're done with it.

Instead of calling Py_Exit(sts), call Py_Cleanup() and return sts.

27 years agoAvoid function calls to access the current thread state and builtins
Guido van Rossum [Sat, 2 Aug 1997 02:59:08 +0000 (02:59 +0000)]
Avoid function calls to access the current thread state and builtins
-- the thread state is passed in as an argument and the builtins are a
member thereof.

27 years agoAdded internal routine PyString_Fini() which deletes all interned
Guido van Rossum [Sat, 2 Aug 1997 02:57:45 +0000 (02:57 +0000)]
Added internal routine PyString_Fini() which deletes all interned
strings.  For use in Py_Finalize() only.

27 years agoMass checkin (more to follow for other directories).
Guido van Rossum [Sat, 2 Aug 1997 02:56:48 +0000 (02:56 +0000)]
Mass checkin (more to follow for other directories).

Introduce truly separate (sub)interpreter objects.  For now, these
must be used by separate threads, created from C.  See Demo/pysvr for
an example of how to use this.  This also rationalizes Python's
initialization and finalization behavior:

Py_Initialize() -- initialize the whole interpreter
Py_Finalize() -- finalize the whole interpreter

tstate = Py_NewInterpreter() -- create a new (sub)interpreter
Py_EndInterpreter(tstate) -- delete a new (sub)interpreter

There are also new interfaces relating to threads and the interpreter
lock, which can be used to create new threads, and sometimes have to
be used to manipulate the interpreter lock when creating or deleting
sub-interpreters.  These are only defined when WITH_THREAD is defined:

PyEval_AcquireLock() -- acquire the interpreter lock
PyEval_ReleaseLock() -- release the interpreter lock

PyEval_AcquireThread(tstate) -- acquire the lock and make the thread current
PyEval_ReleaseThread(tstate) -- release the lock and make NULL current

Other administrative changes:

- The header file bltinmodule.h is deleted.

- The init functions for Import, Sys and Builtin are now internal and
  declared in pythonrun.h.

- Py_Setup() and Py_Cleanup() are no longer declared.

- The interpreter state and thread state structures are now linked
  together in a chain (the chain of interpreters is a static variable
  in pythonrun.c).

- Some members of the interpreter and thread structures have new,
  shorter, more consistent, names.

- Added declarations for _PyImport_{Find,Fixup}Extension() to import.h.

27 years agoAdd cast to PyInt_AS_LONG macro, as suggested by Marc Lemburg.
Guido van Rossum [Sat, 2 Aug 1997 02:41:13 +0000 (02:41 +0000)]
Add cast to PyInt_AS_LONG macro, as suggested by Marc Lemburg.