no module named exceptions?

Ned Deily nad at acm.org
Thu Apr 1 16:16:06 EDT 2010


In article 
<l2g50697b2c1004011245l80c169e6k5be038e8ca75b22b at mail.gmail.com>,
 Chris Rebert <clp2 at rebertia.com> wrote:

> > On Thu, Apr 1, 2010 at 10:42 PM, Joaquin Abian <gatoygata2 at gmail.com> wrote:
> >> In python 3.1,
> >>
> >> >>> import exceptions
> >> Traceback (most recent call last):
> >>  File "<pyshell#6>", line 1, in <module>
> >>    import exceptions
> >> ImportError: No module named exceptions
> >>
> >> in 2.6 no exception is raised
> >> It should be the same in 3.1, isnt it?
> 
> On Thu, Apr 1, 2010 at 10:37 AM, Tommy Grav <tgrav at mac.com> wrote:
> > This is what he is expecting. Importing exceptions works fine in 2.6.4, not
> > so
> > in python 3.1.
> > Python 2.6.4 (r264:75706, Nov  3 2009, 18:12:54)
> > [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import exceptions
> >>>>
> 
> It appears to have been removed between Python 3.1.2
> (http://docs.python.org/py3k/modindex.html#cap-E) and Python 3.2a0
> (http://docs.python.org/dev/py3k/modindex.html#cap-E). Exactly why, I
> don't know. I wasn't able to locate anything about it in a quick scan
> of the Python 3000 PEPs.

The exceptions module doesn't exist in Python 3 but the documentation 
had not been cleaned up until recently:

http://bugs.python.org/issue7590

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list