summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 86a6aa02c1..ff9a5f4ec8 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1113,7 +1113,7 @@ class TextDoc(Doc):
result = result + self.section('CREDITS', str(object.__credits__))
return result
- def docclass(self, object, name=None, mod=None):
+ def docclass(self, object, name=None, mod=None, *ignored):
"""Produce text documentation for a given class object."""
realname = object.__name__
name = name or realname
@@ -1533,11 +1533,11 @@ class Helper:
# These dictionaries map a topic name to either an alias, or a tuple
# (label, seealso-items). The "label" is the label of the corresponding
# section in the .rst file under Doc/ and an index into the dictionary
- # in pydoc_topics.py.
+ # in pydoc_data/topics.py.
#
# CAUTION: if you change one of these dictionaries, be sure to adapt the
# list of needed labels in Doc/tools/sphinxext/pyspecific.py and
- # regenerate the pydoc_topics.py file by running
+ # regenerate the pydoc_data/topics.py file by running
# make pydoc-topics
# in Doc/ and copying the output file into the Lib/ directory.
@@ -1718,8 +1718,9 @@ class Helper:
return ''
return '<pydoc.Helper instance>'
- def __call__(self, request=None):
- if request is not None:
+ _GoInteractive = object()
+ def __call__(self, request=_GoInteractive):
+ if request is not self._GoInteractive:
self.help(request)
else:
self.intro()
@@ -1825,11 +1826,11 @@ Here is a list of available topics. Enter any topic name to get more help.
def showtopic(self, topic, more_xrefs=''):
try:
- import pydoc_topics
+ import pydoc_data.topics
except ImportError:
self.output.write('''
Sorry, topic and keyword documentation is not available because the
-module "pydoc_topics" could not be found.
+module "pydoc_data.topics" could not be found.
''')
return
target = self.topics.get(topic, self.keywords.get(topic))
@@ -1841,7 +1842,7 @@ module "pydoc_topics" could not be found.
label, xrefs = target
try:
- doc = pydoc_topics.topics[label]
+ doc = pydoc_data.topics.topics[label]
except KeyError:
self.output.write('no documentation found for %s\n' % repr(topic))
return
@@ -2031,8 +2032,8 @@ pydoc</strong> by Ka-Ping Yee &lt;ping@lfw.org&gt;</font>'''
class DocServer(BaseHTTPServer.HTTPServer):
def __init__(self, port, callback):
- host = (sys.platform == 'mac') and '127.0.0.1' or 'localhost'
- self.address = ('', port)
+ host = 'localhost'
+ self.address = (host, port)
self.url = 'http://%s:%d/' % (host, port)
self.callback = callback
self.base.__init__(self, self.address, self.handler)
@@ -2148,10 +2149,6 @@ def gui():
except ImportError: # pre-webbrowser.py compatibility
if sys.platform == 'win32':
os.system('start "%s"' % url)
- elif sys.platform == 'mac':
- try: import ic
- except ImportError: pass
- else: ic.launchurl(url)
else:
rc = os.system('netscape -remote "openURL(%s)" &' % url)
if rc: os.system('netscape "%s" &' % url)