diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1995-08-17 14:29:23 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1995-08-17 14:29:23 (GMT) |
commit | 9f37c6d91c1134bd44ee74e2ac77d5e1435f4e71 (patch) | |
tree | 050fb6294cfca6bf128efd5c8d2b0f47f2a16459 /Mac/Modules | |
parent | caf7505edc872e1a6dc25b70176227b1d7754e93 (diff) | |
download | cpython-9f37c6d91c1134bd44ee74e2ac77d5e1435f4e71.zip cpython-9f37c6d91c1134bd44ee74e2ac77d5e1435f4e71.tar.gz cpython-9f37c6d91c1134bd44ee74e2ac77d5e1435f4e71.tar.bz2 |
Added ResObj_OptNew, like ResObj_New but returns None when passed NULL.
Diffstat (limited to 'Mac/Modules')
-rw-r--r-- | Mac/Modules/res/ressupport.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Mac/Modules/res/ressupport.py b/Mac/Modules/res/ressupport.py index e2bfa79..fd4f4e6 100644 --- a/Mac/Modules/res/ressupport.py +++ b/Mac/Modules/res/ressupport.py @@ -30,6 +30,19 @@ includestuff = includestuff + """ """ finalstuff = finalstuff + """ + +/* Alternative version of ResObj_New, which returns None for null argument */ +PyObject *ResObj_OptNew(itself) + Handle itself; +{ + ResourceObject *it; + if (itself == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + return ResObj_New(itself); +} + """ initstuff = initstuff + """ |