Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing "import sys" in Tools/gdb/libpython.py #53481

Closed
YaroslavHalchenko mannequin opened this issue Jul 12, 2010 · 3 comments
Closed

missing "import sys" in Tools/gdb/libpython.py #53481

YaroslavHalchenko mannequin opened this issue Jul 12, 2010 · 3 comments

Comments

@YaroslavHalchenko
Copy link
Mannequin

YaroslavHalchenko mannequin commented Jul 12, 2010

BPO 9235
Nosy @birkenfeld, @davidmalcolm

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2010-07-14.08:56:19.761>
created_at = <Date 2010-07-12.20:40:33.620>
labels = []
title = 'missing "import sys" in Tools/gdb/libpython.py'
updated_at = <Date 2010-07-14.08:56:19.759>
user = 'https://bugs.python.org/YaroslavHalchenko'

bugs.python.org fields:

activity = <Date 2010-07-14.08:56:19.759>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2010-07-14.08:56:19.761>
closer = 'georg.brandl'
components = ['Demos and Tools']
creation = <Date 2010-07-12.20:40:33.620>
creator = 'Yaroslav.Halchenko'
dependencies = []
files = []
hgrepos = []
issue_num = 9235
keywords = []
message_count = 3.0
messages = ['110134', '110135', '110260']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'dmalcolm', 'Yaroslav.Halchenko']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue9235'
versions = ['Python 2.7']

@YaroslavHalchenko
Copy link
Mannequin Author

YaroslavHalchenko mannequin commented Jul 12, 2010

as you can see from below, sys. is used, but never imported (besides a docstring)

$> git describe
upstream/0.5.0.dev-875-gf06319e

$> grep -5 'sys' /home/yoh/proj/misc/python/Tools/gdb/libpython.py

"""
During development, I've been manually invoking the code in this way:
(gdb) python

import sys
sys.path.append('/home/david/coding/python-gdb')
import libpython
end

then reloading it after each edit like this:
(gdb) python reload(libpython)

    def print_summary(self):
        if self.is_evalframeex():
            pyop = self.get_pyop()
            if pyop:
                sys.stdout.write('#%i %s\n' % (self.get_index(), pyop.get_truncated_repr(MAX_OUTPUT_LEN)))
                sys.stdout.write(pyop.current_line())
            else:
                sys.stdout.write('#%i (unable to read python frame information)\n' % self.get_index())
        else:
            sys.stdout.write('#%i\n' % self.get_index())

class PyList(gdb.Command):
    '''List the current Python source code, if any
Use

--
for i, line in enumerate(all_lines[start-1:end]):
linestr = str(i+start)
# Highlight current line:
if i + start == lineno:
linestr = '>' + linestr
sys.stdout.write('%4s %s' % (linestr, line))

# ...and register the command:
PyList()

@YaroslavHalchenko
Copy link
Mannequin Author

YaroslavHalchenko mannequin commented Jul 12, 2010

sorry -- git describe was by mistake in there... report is based on SVN revision 82502

@birkenfeld
Copy link
Member

Thanks, fixed in r82874.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant