From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5829 invoked by alias); 10 Oct 2013 19:59:17 -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 5815 invoked by uid 89); 10 Oct 2013 19:59:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: ausc60pc101.us.dell.com Received: from ausc60pc101.us.dell.com (HELO ausc60pc101.us.dell.com) (143.166.85.206) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 10 Oct 2013 19:59:11 +0000 X-LoopCount0: from 10.175.216.249 From: To: CC: , , Subject: Re: [PATCH 2/2] test: ensure certain types exposed to python are not instancable Date: Thu, 10 Oct 2013 19:59:00 -0000 Message-ID: References: <1377873604-15519-1-git-send-email-sanimir.agovic@intel.com> <1377873604-15519-3-git-send-email-sanimir.agovic@intel.com> <87txgp5473.fsf@fleche.redhat.com> In-Reply-To: <87txgp5473.fsf@fleche.redhat.com> Content-Type: text/plain; charset="us-ascii" Content-ID: <8DCAFF50EF95064FA1F45F25CDD261F0@dell.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00366.txt.bz2 That syntax was added in Python 2.6. If you want to handle older Pythons, = you need to use plain "except $exception" and extract the value ("e") via "= e =3D sys.exc_info ()[1]". That workaround shows up in a number of other s= pots in the testsuite. paul On Oct 10, 2013, at 3:14 PM, Tom Tromey wrote: >>>>>> "Sanimir" =3D=3D Sanimir Agovic writes: >=20 > Sanimir> The proc gdb_py_test_exception executes a piece of python code a= nd > Sanimir> expects an exception of type EXCEPTION to be raised by the code = with > Sanimir> an optional MESSAGE for fine grained filtering. >=20 > FWIW I generally put the test cases in the same patch as the > modification; same with the docs. That's because they are a conceptual > unit. >=20 > It looks good, however -- >=20 > Sanimir> + gdb_py_test_multiple "$stmt throws $exception" \ > Sanimir> + "python" "" \ > Sanimir> + "try:" "" \ > Sanimir> + " $stmt" "" \ > Sanimir> + "except $exception as e:" "" \ >=20 > ... there's one version of Python we support that doesn't have this > syntax. I forget which one, I know Phil remembers though. >=20 > Tom