From: Eduardo Habkost Subject: Re: [KVM-AUTOTEST PATCH v2 3/6] [RFC] Introduce exception context strings Date: Wed, 5 Jan 2011 17:10:27 -0200 Message-ID: <20110105191027.GH3361@otherpad.lan.raisama.net> References: <1294242329-11034-1-git-send-email-mgoldish@redhat.com> <1294242329-11034-3-git-send-email-mgoldish@redhat.com> <4D249855.30607@redhat.com> <20110105162127.GE3361@otherpad.lan.raisama.net> <4D24BEB0.4040502@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , autotest@test.kernel.org, kvm@vger.kernel.org To: Michael Goldish Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54360 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751322Ab1AETKb (ORCPT ); Wed, 5 Jan 2011 14:10:31 -0500 Content-Disposition: inline In-Reply-To: <4D24BEB0.4040502@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jan 05, 2011 at 08:55:44PM +0200, Michael Goldish wrote: > On 01/05/2011 06:21 PM, Eduardo Habkost wrote: > > By the way, I think we could make _new_context() and _pop_context() part > > of the public interface (i.e. remove the "_" from their names). I see > > @context_aware as just a helper for a stack interface that could be used > > directly if needed. > > To actually use the context you also have to insert it into an > exception, i.e. > > _new_context('foo') > try: > try: > ... > except Exception, e: > e._context = get_context() > finally: > _pop_context() True. Just forget about my suggestion. :) -- Eduardo