]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
sysset(name, NULL) does nothing if sys.name is undefined
authorGuido van Rossum <guido@python.org>
Sun, 26 Jan 1992 18:15:48 +0000 (18:15 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 26 Jan 1992 18:15:48 +0000 (18:15 +0000)
Python/sysmodule.c

index d725c88cc8b0debf8e0404cc022bc11e3ba3c5e4..7089fc7a3d81cf5b212df788e03df278152a4236 100644 (file)
@@ -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);
 }