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.

classification
Title: inspect.py module
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: pedronis Nosy List: jlgijsbers, pedronis, sprasanna199
Priority: normal Keywords:

Created on 2004-12-18 15:33 by sprasanna199, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg23769 - (view) Author: sprasanna199 (sprasanna199) Date: 2004-12-18 15:33
I tried to compile python 2.4 inspect.py module in
Jython but it throwed an exception. The line 749 in the
inspect.py module caused the exception which is

start = lineno - 1 - context//2

The code corresponding to it was also shown.

But when I modified that line to 

start = lineno - 1 - context/2

it worked.

Regards,
S.Prasanna

Code:

if context > 0:
        start = lineno - 1 - context//2
        try:
            lines, lnum = findsource(frame)
        except IOError:
            lines = index = None
        else:
            start = max(start, 1)
            start = min(start, len(lines) - context)
            lines = lines[start:start+context]
            index = lineno - 1 - start
    else:
        lines = index = None
msg23770 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2004-12-20 13:07
Logged In: YES 
user_id=469548

This is not a bug in Python. The '//' operator was
introduced in Python 2.2, while Jython is still tracking
Python 2.1.
History
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41338
2004-12-18 15:33:14sprasanna199create