Mercurial > cpython-lru_cache-weakref
annotate Python/pyfpe.c @ 5758:bfe9ba74c19e legacy-trunk
Fix problem discovered by Greg McFarlane: when an imported module
replaces its own entry in sys.module, reference count errors ensue;
even if there is no reference count problem, it would be preferable
for the import to yield the new thing in sys.modules anyway (if only
because that's what later imports will yield). This opens the road to
an official hack to implement a __getattr__ like feature for modules:
stick an instance in sys.modules[__name__].
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 10 Jul 1997 18:00:45 +0000 |
| parents | 74c12704a0bd |
| children | a00073f2e087 |
| rev | line source |
|---|---|
|
5119
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 #include "config.h" |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 #include "pyfpe.h" |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
4 /* |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
5 * The signal handler for SIGFPE is actually declared in an external |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
6 * module fpectl, or as preferred by the user. These variable |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 * definitions are required in order to compile Python without |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 * getting missing externals, but to actually handle SIGFPE requires |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
9 * defining a handler and enabling generation of SIGFPE. |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 */ |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 #ifdef WANT_SIGFPE_HANDLER |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 jmp_buf PyFPE_jbuf; |
|
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 int PyFPE_counter = 0; |
|
5197
74c12704a0bd
New form of PyFPE_END_PROTECT macro.
Guido van Rossum <guido@python.org>
parents:
5119
diff
changeset
|
15 double PyFPE_dummy(){return(1.0);} |
|
5119
bda01a374762
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
16 #endif |
