Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #21710 > unrolled thread
| Started by | "Prasad, Ramit" <ramit.prasad@jpmorgan.com> |
|---|---|
| First post | 2012-03-15 20:25 +0000 |
| Last post | 2012-03-15 20:25 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
RE: Context Manager getting str instead of AttributeError instance "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-03-15 20:25 +0000
| From | "Prasad, Ramit" <ramit.prasad@jpmorgan.com> |
|---|---|
| Date | 2012-03-15 20:25 +0000 |
| Subject | RE: Context Manager getting str instead of AttributeError instance |
| Message-ID | <mailman.700.1331843179.3037.python-list@python.org> |
> > ... > > (<type 'exceptions.AttributeError'>, "'A' object has no attribute 'x'", > <traceback object at 0x1817F648>) > > AttributeError: 'A' object has no attribute 'x' > > > > As you can see, I am getting a string while you are not. > >Ian Kelly said: > Looks like a version difference. I don't have Python 2.6 handy to > test on, but I get a str in Python 2.5 and an AttributeError instance > in Python 2.7. Thanks Ian, that was the key! I guess I will just have to work around it. Any suggestions? I am thinking about just creating a blank instance of the error class since that the class gets passed successfully. Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.
Back to top | Article view | comp.lang.python
csiph-web