summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-01-26 18:15:48 (GMT)
committerGuido van Rossum <guido@python.org>1992-01-26 18:15:48 (GMT)
commit5ad58c6aef158666fe94fefd9fc646483f6ad044 (patch)
tree71f438d6a89e88dc6930bafd3c69a98d567cb9c8 /Python/sysmodule.c
parente0513dee58578e308bad7f6ad7b5b124f7a18c7b (diff)
downloadcpython-5ad58c6aef158666fe94fefd9fc646483f6ad044.zip
cpython-5ad58c6aef158666fe94fefd9fc646483f6ad044.tar.gz
cpython-5ad58c6aef158666fe94fefd9fc646483f6ad044.tar.bz2
sysset(name, NULL) does nothing if sys.name is undefined
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index d725c88..7089fc7 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -85,8 +85,12 @@ sysset(name, v)
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);
}