Mercurial > cpython-lru_cache-weakref
diff Python/sysmodule.c @ 631:f5a2bc39e10e legacy-trunk
sysset(name, NULL) does nothing if sys.name is undefined
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sun, 26 Jan 1992 18:15:48 +0000 |
| parents | e18f1fa398a3 |
| children | bc5c77fa8006 |
line wrap: on
line diff
--- a/Python/sysmodule.c Sun Jan 26 18:15:22 1992 +0000 +++ b/Python/sysmodule.c Sun Jan 26 18:15:48 1992 +0000 @@ -85,8 +85,12 @@ char *name; object *v; { - if (v == NULL) - return dictremove(sysdict, name); + if (v == NULL) { + if (dictlookup(sysdict, name) == NULL) + return 0; + else + return dictremove(sysdict, name); + } else return dictinsert(sysdict, name, v); }
