Mercurial > cpython-lru_cache-weakref
annotate Python/sigcheck.c @ 17405:afbb65b60fa2 2.0
Inspired by Tim Peters' 1.14->1.15 checkin to asynchat
Quoting orignal message:
'''
Fix from the Madusa mailing list:
http://groups.yahoo.com/group/medusa/message/333
It's clear that Medusa should not be checking for an empty buffer
via "buf is ''". The patch merely changes "is" to "==". However,
there's a mystery here all the same: Python attempts to store null
strings uniquely, so it's unclear why "buf is ''" ever returned
false when buf actually was empty. *Some* string operations produce
non-unique null strings, e.g.
'''
| author | Moshe Zadka <moshez@math.huji.ac.il> |
|---|---|
| date | Wed, 11 Apr 2001 08:06:02 +0000 |
| parents | 6f6f965c5e2d |
| children |
| rev | line source |
|---|---|
|
1660
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 /* Sigcheck is similar to intrcheck() but sets an exception when an |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 interrupt occurs. It can't be in the intrcheck.c file since that |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
4 file (and the whole directory it is in) doesn't know about objects |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
5 or exceptions. It can't be in errors.c because it can be |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
6 overridden (at link time) by a more powerful version implemented in |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 signalmodule.c. */ |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 |
|
5373
5880384d7c71
Quickly renamed the remaining files -- this directory is done.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
9 #include "Python.h" |
|
1660
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 /* ARGSUSED */ |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 int |
|
13658
f79434ee41fa
Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents:
13256
diff
changeset
|
13 PyErr_CheckSignals(void) |
|
1660
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 { |
|
5373
5880384d7c71
Quickly renamed the remaining files -- this directory is done.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
15 if (!PyOS_InterruptOccurred()) |
|
1660
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
16 return 0; |
|
5373
5880384d7c71
Quickly renamed the remaining files -- this directory is done.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
17 PyErr_SetNone(PyExc_KeyboardInterrupt); |
|
1660
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
18 return -1; |
|
ffd495bacbd4
Replace intrcheck() by sigcheck() in many places.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
19 } |
