From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8746 invoked by alias); 8 Oct 2010 21:35:31 -0000 Received: (qmail 8664 invoked by uid 22791); 8 Oct 2010 21:35:30 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Oct 2010 21:35:26 +0000 Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by smtp-out.google.com with ESMTP id o98LZNnL001906 for ; Fri, 8 Oct 2010 14:35:23 -0700 Received: from vws9 (vws9.prod.google.com [10.241.21.137]) by wpaz1.hot.corp.google.com with ESMTP id o98LYBpJ004739 for ; Fri, 8 Oct 2010 14:35:22 -0700 Received: by vws9 with SMTP id 9so608538vws.34 for ; Fri, 08 Oct 2010 14:35:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.201.70 with SMTP id ez6mr872814vcb.66.1286573721685; Fri, 08 Oct 2010 14:35:21 -0700 (PDT) Received: by 10.220.118.2 with HTTP; Fri, 8 Oct 2010 14:35:21 -0700 (PDT) In-Reply-To: References: <20101008191154.GA13058@host1.dyn.jankratochvil.net> Date: Fri, 08 Oct 2010 21:35:00 -0000 Message-ID: Subject: Re: [patch] python(+solib error): save/restore error state From: Doug Evans To: Tom Tromey Cc: Jan Kratochvil , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2010-10/txt/msg00164.txt.bz2 On Fri, Oct 8, 2010 at 2:27 PM, Tom Tromey wrote: >>>>>> "Doug" == Doug Evans writes: > > Doug> Looking at the sources for PyRun_SimpleFile, I see PyErr_Print being > Doug> called before -1 is returned. > Doug> Similarly for PyRun_SimpleString. > > Doug> Am I missing something? > > In that case we should probably just call PyErr_Clear. Except that my understanding is that that is unnecessary. PyErr_Print is defined to clear the error indicator. For reference sake, according to the docs, the error is saved in python vars sys.last_{type,value,traceback}. We might want to clear/save/restore those.