Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c2578c5

Browse files
committed
load_refcounts(),
do_env_cfuncdesc(): Support the "null" value for the refcounts field in refcounts.dat.
1 parent db2764d commit c2578c5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Doc/perl/python.perl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ sub load_refcounts{
600600
open(REFCOUNT_FILE, "<$filename") || die "\n$!\n";
601601
print "[loading API refcount data]";
602602
while (<REFCOUNT_FILE>) {
603-
if (/([a-zA-Z0-9_]+):PyObject\*:([a-zA-Z0-9_]*):(0|[-+]1):(.*)$/) {
603+
if (/([a-zA-Z0-9_]+):PyObject\*:([a-zA-Z0-9_]*):(0|[-+]1|null):(.*)$/) {
604604
my($func, $param, $count, $comment) = ($1, $2, $3, $4);
605605
#print "\n$func($param) --> $count";
606606
$REFCOUNTS{"$func:$param"} = $count;
@@ -634,6 +634,10 @@ sub do_env_cfuncdesc{
634634
$rcinfo = '<span class="label">Return value:</span>'
635635
. "\n <span class=\"value\">Borrowed reference.</span>";
636636
}
637+
elsif ($result_rc eq 'null') {
638+
$rcinfo = '<span class="label">Return value:</span>'
639+
. "\n <span class=\"value\">Always NULL.</span>";
640+
}
637641
if ($rcinfo ne '') {
638642
$rcinfo = "\n<div class=\"refcount-info\">\n $rcinfo\n</div>";
639643
}

0 commit comments

Comments
 (0)