Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 788:ba4ec13c0f9f legacy-trunk
Fix reference counts of sys_trace and sys_profile
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sun, 05 Apr 1992 14:17:55 +0000 |
| parents | bc5c77fa8006 |
| children | fea3f594df77 |
comparison
equal
deleted
inserted
replaced
| 787:44319df6a91c | 788:ba4ec13c0f9f |
|---|---|
| 1 /*********************************************************** | 1 /*********************************************************** |
| 2 Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The | 2 Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The |
| 3 Netherlands. | 3 Netherlands. |
| 4 | 4 |
| 5 All Rights Reserved | 5 All Rights Reserved |
| 6 | 6 |
| 7 Permission to use, copy, modify, and distribute this software and its | 7 Permission to use, copy, modify, and distribute this software and its |
| 99 object *self; | 99 object *self; |
| 100 object *args; | 100 object *args; |
| 101 { | 101 { |
| 102 if (args == None) | 102 if (args == None) |
| 103 args = NULL; | 103 args = NULL; |
| 104 XINCREF(args); | 104 else |
| 105 INCREF(args); | |
| 106 XDECREF(sys_trace); | |
| 105 sys_trace = args; | 107 sys_trace = args; |
| 106 INCREF(None); | 108 INCREF(None); |
| 107 return None; | 109 return None; |
| 108 } | 110 } |
| 109 | 111 |
| 112 object *self; | 114 object *self; |
| 113 object *args; | 115 object *args; |
| 114 { | 116 { |
| 115 if (args == None) | 117 if (args == None) |
| 116 args = NULL; | 118 args = NULL; |
| 117 XINCREF(args); | 119 else |
| 120 INCREF(args); | |
| 121 XDECREF(sys_profile); | |
| 118 sys_profile = args; | 122 sys_profile = args; |
| 119 INCREF(None); | 123 INCREF(None); |
| 120 return None; | 124 return None; |
| 121 } | 125 } |
| 122 | 126 |
