From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4682 invoked by alias); 20 Aug 2013 19:59:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 4668 invoked by uid 89); 20 Aug 2013 19:59:20 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 20 Aug 2013 19:59:18 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7KJxGRx000447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Aug 2013 15:59:17 -0400 Received: from barimba (ovpn-113-142.phx2.redhat.com [10.3.113.142]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r7KJxFgC024533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 20 Aug 2013 15:59:16 -0400 From: Tom Tromey To: Phil Muldoon Cc: "gdb-patches\@sourceware.org" Subject: Re: [patch] [python] Fix Python 3 build and testsuite issues References: <521230C8.2040803@redhat.com> <878uzxlkl1.fsf@fleche.redhat.com> <52124B8D.6010609@redhat.com> <87ppt9jzrl.fsf@fleche.redhat.com> <5213C6BA.7030703@redhat.com> Date: Tue, 20 Aug 2013 19:59:00 -0000 In-Reply-To: <5213C6BA.7030703@redhat.com> (Phil Muldoon's message of "Tue, 20 Aug 2013 20:42:50 +0100") Message-ID: <87d2p8gmlo.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-08/txt/msg00558.txt.bz2 >>>>> "Phil" == Phil Muldoon writes: Phil> @@ -236,7 +236,7 @@ class FrameVars(object): Phil> # SYM may be a string instead of a symbol in the case of Phil> # synthetic local arguments or locals. If that is the case, Phil> # always fetch. Phil> - if isinstance(sym, basestring): Phil> + if isinstance(sym, str): Phil> return True Does this work in all versions? I thought perhaps hasattr would be more robust here. Phil> if (py_func != NULL) Phil> { Phil> - const char *function = NULL; Phil> + char *function_to_free = NULL; Phil> + const char *function; Phil> if (gdbpy_is_string (py_func)) Phil> { Phil> - function = PyString_AsString (py_func); Phil> + function = function_to_free = Phil> + python_string_to_host_string (py_func); I think it's preferable to declare function_to_free in the innermost scope. Tom