Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'assignment': 0.07; 'odd': 0.07; 'exception,': 0.09; 'happen?': 0.09; 'raises': 0.09; 'subject:module': 0.09; 'works.': 0.09; 'suggest': 0.14; 'args.': 0.16; 'exception:': 0.16; 'imports': 0.16; 'received:172.18.0': 0.16; 'subclasses': 0.16; 'typeerror:': 0.16; 'exception': 0.16; 'obviously': 0.18; 'module': 0.19; 'passing': 0.19; 'module,': 0.24; 'subject:problem': 0.24; 'header:Received:8': 0.24; 'handling': 0.26; 'code': 0.31; 'catching': 0.31; 'file': 0.32; 'another': 0.32; 'cases': 0.33; 'subject:with': 0.35; 'classes': 0.35; 'except': 0.35; 'something': 0.35; 'but': 0.35; 'done': 0.36; 'charset:us-ascii': 0.36; 'so,': 0.37; 'to:addr:python- list': 0.38; '12,': 0.39; 'to:addr:python.org': 0.39; 'catch': 0.60; 'received:unknown': 0.61; 'new': 0.61; 'back': 0.62 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=OwXf4AQYS7J10u4+/2kpCX1VHJ+qeA/E1g375LKBsDQ= c=1 sm=1 a=7PYXob_7ZXMA:10 a=P90J6pEA2ccA:10 a=BLceEmwcHowA:10 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=oNw28mxuUhXRB3mVwYQ4Ag==:17 a=J9xtMBLOfnTyqgctOvgA:9 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=activenetwerx.com; s=default; t=1400000438; bh=JWYh1fQieXhGhuL/HWf79Pt7w0qX/ajY0meWSY523Ys=; h=From:To:Subject:Date; b=E6gWoHb+xplzZibkwL7/YohgnzNhfioIbQtVBDSNZdPuISU4GTbUHb70DHIJ+QomH qQ00jprkNmFbnswRA111xMmxKFT7GOY+5ecNIVC2942CPMAtByEhhavr2gpaFzmanc G2wLWDP9/Ir5lPoglXKCIPdSLPkN86Wzf5pVJ/MI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=activenetwerx.com; s=default; t=1400000438; bh=JWYh1fQieXhGhuL/HWf79Pt7w0qX/ajY0meWSY523Ys=; h=From:To:Subject:Date; b=E6gWoHb+xplzZibkwL7/YohgnzNhfioIbQtVBDSNZdPuISU4GTbUHb70DHIJ+QomH qQ00jprkNmFbnswRA111xMmxKFT7GOY+5ecNIVC2942CPMAtByEhhavr2gpaFzmanc G2wLWDP9/Ir5lPoglXKCIPdSLPkN86Wzf5pVJ/MI= X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.activenetwerx.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=ham version=3.3.1 From: "Joseph L. Casale" To: Python Subject: Exception problem with module Thread-Topic: Exception problem with module Thread-Index: AQHPbsriLeIN+SWW90mOr8A0k8UUzw== Date: Tue, 13 May 2014 16:59:46 +0000 Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.18.0.4] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1400000510 news.xs4all.nl 2888 [2001:888:2000:d::a6]:35542 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71503 I am working with a module that I am seeing some odd behavior.=0A= =0A= A module.foo builds a custom exception, module.foo.MyError, its done right= =0A= afaict.=0A= =0A= Another module, module.bar imports this and calls bar.__setattr__('a_new_na= me', MyError).=0A= =0A= Now, not in all but in some cases when I catch a_new_name, my code raises a= new=0A= exception:=0A= =0A= During handling of the above exception, another exception occurred:=0A= =0A= File "C:/dir/test.py", line 12, in =0A= except a_new_name as exc:=0A= TypeError: catching classes that do not inherit from BaseException is not a= llowed=0A= =0A= So, I wont suggest the assignment in bar added anything, nor would I do thi= s, but=0A= its what I am working with. Why might this happen? MyError subclasses Excep= tion=0A= and calls super passing back args.=0A= =0A= This has something to do with the assignment in bar, catching MyError obvio= usly works.=0A= =0A= Any ideas?=0A= jlc=