Commit graph

6602 commits

Author SHA1 Message Date
Guido van Rossum ee6fd1c392 Add declaration for _Py_PackageContext -- needed to fix importing
of shared libraries from inside packages.
1997-11-19 18:51:35 +00:00
Guido van Rossum 858cb73bb2 Two changes (here we go again :-( ).
1) The __builtins__ variable in the __main__ module is set to the
__builtin__ module instead of its __dict__.

2) Get rid of the SIGHUP and SIGTERM handlers.  They can't be made to
work reliably when threads may be in use, they are Unix specific, and
Python programmers can now program this functionality is a safer way
using the signal module.
1997-11-19 16:15:37 +00:00
Guido van Rossum df9db1ea18 Give more detailed error message when the argument count isn't right. 1997-11-19 16:05:40 +00:00
Guido van Rossum 127b8dd8d4 Add declaration for PyNumber_CoerceEx(). 1997-11-19 16:04:54 +00:00
Guido van Rossum 242c64256c Add a new function PyNumber_CoerceEx() which works just like
PyNumber_Coerce() except that when the coercion can't be done and no
other exceptions happen, it returns 1 instead of raising an
exception.

Use this function in PyObject_Compare() to avoid raising an exception
simply because two objects with numeric behavior can't be coerced to a
common type; instead, proceed with the non-numeric default comparison.

Note that this is a somewhat questionable practice -- comparisons for
numeric objects shouldn't default to random behavior like this, but it
is required for backward compatibility.  (Case in point, it broke
comparison of kjDict objects to integers in Aaron Watters' kjbuckets
extension.)  A correct fix (for python 2.0) should involve a different
definiton of comparison altogether.
1997-11-19 16:03:17 +00:00
Guido van Rossum 220ecc8c4b Martin von Loewis' _locale module (locale.py follows tomorrow). 1997-11-18 21:03:39 +00:00
Guido van Rossum 3931df9250 Undo another glitch of the automatic not-so-Grand Renaming; some local
variables called 'coerce' were accidentally renamed to
'PyNumber_Coerce'.  Rename them back to coercefunc.
1997-11-18 19:23:07 +00:00
Guido van Rossum 33635f818a start numbering things 1.5b1 now 1997-11-18 19:21:47 +00:00
Guido van Rossum 83600050d0 Assert that the proxies object passed in to the URLopener constructor
is indeed a dictionary (or a mapping).
1997-11-18 15:50:39 +00:00
Guido van Rossum 421c224044 Added docstrings (contributed by Martin von Loewis). 1997-11-18 15:47:55 +00:00
Guido van Rossum e4a93bc4b3 Fix the release date for 1.5b1 to be Nov. 26 1997-11-18 15:32:15 +00:00
Guido van Rossum d9a26ff9ca Add support for NULL macro (like UNIX, ABC etc.). 1997-11-18 15:31:16 +00:00
Guido van Rossum 2974f0fe9a Add xmllib; remove (slow) from description of htmllib. 1997-11-18 15:30:40 +00:00
Guido van Rossum 7336935e4c dis is now documented; bisect is deemed useful. 1997-11-18 15:30:13 +00:00
Guido van Rossum f7790c608d Document s.connect_ex(), which does not raise an exception on error. 1997-11-18 15:29:20 +00:00
Guido van Rossum 364e643fdd Clarified reference to old profiler.
Mention conversion to Perl-style regular expressions.
1997-11-18 15:28:46 +00:00
Guido van Rossum 5de64883d8 Added doc for errorcode dictionary. 1997-11-18 15:27:51 +00:00
Guido van Rossum 5d68e8e312 Fixed case sensitivity of attributes (they are case *sensitive*). 1997-11-18 15:27:20 +00:00
Guido van Rossum eae121e436 Adding dis and xmllib docs 1997-11-18 15:11:47 +00:00
Guido van Rossum a10768ae44 Docu for xmllib.py, by Sjoerd Mullender. 1997-11-18 15:11:22 +00:00
Guido van Rossum b62b6d145e Docu for dis.py, written by Martin von Loewis. 1997-11-18 15:10:53 +00:00
Guido van Rossum a219efaa7b Sjoerd Mullender's xml parser (based on sgmllib, somewhat). 1997-11-18 15:09:54 +00:00
Guido van Rossum 46de1b0669 This BUGS list hasn't been updated since the release of Python 1.2!
It is useless.  My real bugs database is currently being maintained
with GNATS.
1997-11-14 23:32:19 +00:00
Guido van Rossum 359bcaa539 This fix (across 4 files in 3 directories) solves a subtle problem with
signal handlers in a fork()ed child process when Python is compiled with
thread support.  The bug was reported by Scott <scott@chronis.icgroup.com>.

What happens is that after a fork(), the variables used by the signal
module to determine whether this is the main thread or not are bogus,
and it decides that no thread is the main thread, so no signals will
be delivered.

The solution is the addition of PyOS_AfterFork(), which fixes the signal
module's variables.  A dummy version of the function is present in the
intrcheck.c source file which is linked when the signal module is not
used.
1997-11-14 22:24:28 +00:00
Guido van Rossum c9fd600640 Suggestion by David Ascher: set EXE macro to empty string and use it
in a few places -- so it can be set to .exe on GNUWIN32 platforms and
do the right thing.  Whatever.  (This was already done in
Modules/Makefile* but wasn't carried over here.)
1997-11-11 18:29:22 +00:00
Guido van Rossum 6592b3c01e Use a %s format for the exit status -- through the magical workings of
the aptly named MagicDict class, the value is a string, not a number,
by the time it is printed...
1997-11-11 17:18:48 +00:00
Guido van Rossum ca2f69cb96 As Mark Hammond found out, it was a bad idea to add "set -e" to the
check in command -- this fails for new files!
1997-11-11 17:17:55 +00:00
Guido van Rossum 6f5a312cec New version from Neale... He promised it's the last. 1997-11-11 16:36:14 +00:00
Guido van Rossum dfed725e2c Fix memory leak in exec statement with code object -- the None returned
by PyEval_EvalCode() on success was never DECREF'ed.

Fix by Bernhard Herzog.
1997-11-11 16:29:38 +00:00
Guido van Rossum 3120bc3888 v1.1; added attribution to Neale Pickett. 1997-11-08 07:16:19 +00:00
Guido van Rossum 368e06b6f0 Some restructuring.
All geometry manager methods that apply to a master widget instead of
to a slave widget have been moved to the Misc class, which is
inherited by all of Tk(), Toplevel() and Widget().  They have been
renamed to have their geometry manager name as a prefix,
e.g. pack_propagate(); the short names can still be used where
ambiguities are resolved so that pack has priority over place has
priority over grid (since this was the old rule).

Also, the method definitions in the Pack, Place and Grid classes now
all have their respective geometry manager name as a prefix
(e.g. pack_configure); the shorter names are aliases defined through
assignment.

A similar renaming has been done for all config() methods found
elsewhere; these have been renamed to configure() with config being
the alias (instead of the other way around).  (This may not make much
of a difference but the official Tk command name is now 'configure'
and it may help in debugging tracebacks.)

Finally, a new base class BaseWidget has been introduced, which
implements the methods common between Widget and Toplevel (the
difference between those two classes is that Toplevel has a different
__init__() but also that Toplevel doesn't inherit from Pack, Place or
Grid.
1997-11-07 20:38:49 +00:00
Guido van Rossum 1abbd7f3f1 Added vgrindefs. 1997-11-07 19:58:10 +00:00
Guido van Rossum 93a47d7c3c Plucked this from the net. 1997-11-07 19:57:54 +00:00
Guido van Rossum f51815426e Fix problem discovered by Barry: if you hit ^C to
sys.stdin.readline(), you get a fatal error (no current thread).  This
is because there was a call to PyErr_CheckSignals() while there was no
current thread.  I wonder how many more of these we find...  I bnetter
go hunting for PyErr_CheckSignals() now...
1997-11-07 19:20:34 +00:00
Guido van Rossum c1189eb524 Separate out a function pystones(loops=LOOPS) which runs the benchmark
and returns a (benchtime, stones) tuple.  The main() function now
calls this and prints the report.  Fred Drake's code.
1997-11-06 15:45:05 +00:00
Guido van Rossum f849291e2b Add __init__.py to test package. 1997-11-06 15:41:23 +00:00
Barry Warsaw 6ae21ad687 #(py-emacs-features): Fixed typo in docstring. 1997-11-06 14:36:49 +00:00
Barry Warsaw b8f1166922 (python-font-lock-keywords): Pick up block introducing keywords with
immediately following colons.  Sjoerd noticed this one too.  Here's a
nonsense.py file that flexes all the font-lock keyword combinations.

class A:
    class B(A):
	pass
    def __init__(self):
	if i == 2 and j == 3 or k == 4:
	    import stuff
	    from otherstuff import cool
	    for i in range(cool.count):
		if i == j:
		    break
		elif j == 1:
		    continue
		print i
	    else:
		return not i
	elif q is not i:
	    return lambda x: x + 1
	else:
	    try:
		try:
		    raise stuff.error
		except stuff.error, v:
		    print v
		except:
		    global q
	    finally:
		while q > 0:
		    q = q - 1
		assert q == 0

def make():
    a = A()
    exec "nonsense"
    del a
1997-11-06 14:35:15 +00:00
Barry Warsaw ef3c891773 (python-font-lock-keywords): Fix for consecutive keyword font locking,
given by Sjoerd Mullender <Sjoerd.Mullender@cwi.nl>.
1997-11-05 18:55:50 +00:00
Barry Warsaw 5e21cb0bfb (py-emacs-features): Test for working make-temp-name, which is broken
on NTEmacs 19.34.6.

(py-serial-number): New variable.

(py-execute-region): If make-temp-name is broken, simply append a
serial number to the string "python-" to get a temporary file name.
It's possible concurrent NTEmacs can step on each others toes, but it
makes no sense to further coddle a busted NTEmacs.
1997-11-05 18:41:11 +00:00
Guido van Rossum 2bd358c9fd A nice blurb that Mark Hammond wrote, aimed at Windows users. 1997-11-05 17:15:02 +00:00
Barry Warsaw a9ce70f3bc (py-execute-region): Fixed small bug with queuing file for execution
in a py-shell.  Temp files now get cleaned up.
1997-11-05 16:56:51 +00:00
Barry Warsaw 2518c67984 (mark-python-def-or-class): Renamed to py-mark-def-or-class globally.
(py-mode-map): Moved py-mark-def-or-class from M-C-h to C-c C-m since
the old binding conflicts with the standard global backward-kill-word
binding, and this new binding is more conformant with other language
modes.  Moved py-mark-block to C-c C-k.
1997-11-05 00:51:08 +00:00
Guido van Rossum 851e7d5159 Got rid of the errorstr dictionary, which is redundant now that
there's os.strerror() -- also, it would form a locale liability.
1997-11-04 20:22:24 +00:00
Guido van Rossum 4a1f39a26b Undo half of the previous change :-(
Setting interp->builtins to the __builtin__ module instead of to its
dictionary had the unfortunate side effect of always running in
restricted execution mode :-(

I will check in a different way of setting __main__.__builtins__ to
the __builtin__ module later.

Also, there was a typo -- a comment was unfinished, and as a result
some finalizations were not being executed.

In Bart Simpson style,

I Will Not Check In Untested Changes.
I Will Not Check In Untested Changes.
I Will Not Check In Untested Changes.
I Will Not Check In Untested Changes.
I Will Not Check In Untested Changes.
I Will Not Check In Untested Changes.
I Will Not Check In Untested Changes.
I Will Not Check In Untested Changes.
I Will Not Check In Untested Changes.
I Will Not Check In Untested Changes.
1997-11-04 19:36:18 +00:00
Barry Warsaw 6d48c4a00b (py-backspace-function): New variable.
(py-electric-backspace, py-electric-delete): Support the XEmacs 20 Way
for backspace and delete mappings.  In XEmacs 19, Emacs 19, and Emacs
20, both backspace and delete keysyms are bound to
py-electric-backspace.  In XEmacs 20, backspace and delete keysyms are
bound separately, allowing the user to specify forward or backward
deletion of the delete keysym through the variable
delete-key-deletes-forward.  All this is the Right Way To Do It and
this implementation was largely ripped from CC Mode.
1997-11-04 19:21:50 +00:00
Barry Warsaw a97a3f34d6 First round of changes, mostly subprocess stuff.
(py-execute-file): Better interaction with comint.  Set
comint-scroll-to-bottom-on-output to t.  Wrapper buffer change in
unwind-protect in case process filter fails.

(py-shell): Start Python with -i flag to fix tty problem on Windows;
presumably -- not yet tested.

(py-clear-queue): New function to clear the pending exec file queue.
Not currently keybound.

(py-execute-region, py-execute-buffer): Added optional async flag (use
via C-u prefix) to execute the region in a new asynchrous buffer, even
if the Python shell is running.

(py-append-to-process-buffer): Removed as obsolete.  Comint provides
this functionality.

Removed fbound test defun of match-string.  All modern X/Emacsen have
this function.
1997-11-04 18:47:06 +00:00
Guido van Rossum bfa9f13e14 islink() returns false, but there is no constant false! Return 0 instead. 1997-11-04 18:40:53 +00:00
Guido van Rossum 79b2038aa4 When checking for equality, open the slave file in text mode so it
will compare equal even if the master file uses only \n to terminate
lines (this is by far the most common situation).  Also, check for the
case where the master file is missing, and print the time difference
in seconds when the slave file appears newer than the master (for
debugging).
1997-11-04 17:35:43 +00:00
Guido van Rossum 19f44560f2 Use `0'' instead of `None'' to reset the underlying object in close
methods.  Using None causes problems if the destructor is called after
the __builtin__ module has already been destroyed (unfortunately, this
can happen!).  I can't just delete the object because it is actually
tested for (if self._sock: ...).  Setting it to 0 is a bit weird but
works.
1997-11-04 17:32:59 +00:00