New submission from Viorel Tabara:

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.

----------
assignee: docs@python
components: Documentation
messages: 277657
nosy: docs@python, viorel
priority: normal
severity: normal
status: open
title: incorrect output "int division or modulo by zero" in Handling Exceptions 
tutorial
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28306>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to