Skip to content

Python 3 compatibility #550

@pmav99

Description

@pmav99

Calling help with a python object results in:

help(int)

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/feanor/.virtualenvs/dem/lib/python3.4/site-packages/bpython/_internal.py", line 24, in __call__
    self.helper(*args, **kwargs)
  File "/usr/lib64/python3.4/pydoc.py", line 1827, in __call__
    self.help(request)
  File "/usr/lib64/python3.4/pydoc.py", line 1877, in help
    else: doc(request, 'Help on %s:', output=self._output)
  File "/usr/lib64/python3.4/pydoc.py", line 1614, in doc
    pager(render_doc(thing, title, forceload))
  File "/home/feanor/.virtualenvs/dem/lib/python3.4/site-packages/bpython/pager.py", line 54, in page
    if isinstance(data, unicode):
NameError: name 'unicode' is not defined

The relevant code is here

Is this appropriate way to fix it?

if py3:
    unicode = str

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions