mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #5320: intersphinx: crashed if invalid url given
This commit is contained in:
parent
2371614227
commit
bde53bf9fb
2
CHANGES
2
CHANGES
@ -16,6 +16,8 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #5320: intersphinx: crashed if invalid url given
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
|
@ -403,6 +403,7 @@ def inspect_main(argv):
|
||||
def warn(self, msg):
|
||||
print(msg, file=sys.stderr)
|
||||
|
||||
try:
|
||||
filename = argv[0]
|
||||
invdata = fetch_inventory(MockApp(), '', filename) # type: ignore
|
||||
for key in sorted(invdata or {}):
|
||||
@ -411,6 +412,10 @@ def inspect_main(argv):
|
||||
print('\t%-40s %s%s' % (entry,
|
||||
einfo[3] != '-' and '%-40s: ' % einfo[3] or '',
|
||||
einfo[2]))
|
||||
except ValueError as exc:
|
||||
print(exc.args[0] % exc.args[1:])
|
||||
except Exception as exc:
|
||||
print('Unknown error: %r' % exc)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user