This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author viorel
Recipients docs@python, viorel
Date 2016-09-28.19:33:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475091230.17.0.768129423451.issue28306@psf.upfronthosting.co.za>
In-reply-to
Content
I'm reading the Python 3.5.2 documentation at:
  
   https://docs.python.org/3/tutorial/errors.html#handling-exceptions

which shows the following example:

   >>> def this_fails():
   ...     x = 1/0
   ...
   >>> try:
   ...     this_fails()
   ... except ZeroDivisionError as err:
   ...     print('Handling run-time error:', err)
   ...
   Handling run-time error: int division or modulo by zero 

Running the code as a script produces:

   $ python3 -V
   Python 3.5.2
   $ python3 p.py
   Handling run-time error: division by zero

   $ python2 -V
   Python 2.7.12
   $ python2 p.py
   ('Handling run-time error:', ZeroDivisionError('integer division or modulo by zero',))
   
The same output is listed for 3.6 and 3.7 tutorials but I don't have those 
versions installed on my system.
History
Date User Action Args
2016-09-28 19:33:50viorelsetrecipients: + viorel, docs@python
2016-09-28 19:33:50viorelsetmessageid: <1475091230.17.0.768129423451.issue28306@psf.upfronthosting.co.za>
2016-09-28 19:33:50viorellinkissue28306 messages
2016-09-28 19:33:50viorelcreate