mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
(partparse.py): Rationalize some behavior around unexpected conditions.
This commit is contained in:
parent
e1980ed1f8
commit
7edd8d3c58
2 changed files with 14 additions and 8 deletions
|
@ -1047,7 +1047,7 @@ def do_funcdesc(length, buf, pp, i):
|
||||||
hist.inargs = save
|
hist.inargs = save
|
||||||
del save
|
del save
|
||||||
the_args = [chunk(PLAIN, wh, '()'[0])] + pp[i:newi] + \
|
the_args = [chunk(PLAIN, wh, '()'[0])] + pp[i:newi] + \
|
||||||
[chunk(PLAIN, wh, '()'[1])]
|
[chunk(PLAIN, wh, '()'[1])]
|
||||||
del pp[i:newi]
|
del pp[i:newi]
|
||||||
length = length - (newi-i)
|
length = length - (newi-i)
|
||||||
|
|
||||||
|
@ -1157,9 +1157,9 @@ def do_datadesc(length, buf, pp, i):
|
||||||
cat_class = 'data'
|
cat_class = 'data'
|
||||||
class_class = string.join(idxsi[2:])
|
class_class = string.join(idxsi[2:])
|
||||||
|
|
||||||
|
|
||||||
if not command:
|
if not command:
|
||||||
raise error, 'don\'t know what to do with indexsubitem ' + `idxsi`
|
return length, i
|
||||||
|
#raise error, 'don\'t know what to do with indexsubitem ' + `idxsi` *)
|
||||||
|
|
||||||
ch.chtype = chunk_type[CSLINE]
|
ch.chtype = chunk_type[CSLINE]
|
||||||
ch.data = command
|
ch.data = command
|
||||||
|
@ -1522,8 +1522,11 @@ def changeit(buf, pp):
|
||||||
elif len(idxsi) >= 2 and idxsi[1] in \
|
elif len(idxsi) >= 2 and idxsi[1] in \
|
||||||
('exception', 'object'):
|
('exception', 'object'):
|
||||||
command = 'vindex'
|
command = 'vindex'
|
||||||
|
elif len(idxsi) == 3 and idxsi[:2] == ['in', 'module']:
|
||||||
|
command = 'cindex'
|
||||||
else:
|
else:
|
||||||
print 'WARNING: can\'t categorize ' + `idxsi` + ' for \'ttindex\' command'
|
print 'WARNING: can\'t categorize ' + `idxsi` \
|
||||||
|
+ ' for \'ttindex\' command'
|
||||||
command = 'cindex'
|
command = 'cindex'
|
||||||
|
|
||||||
if not cat_class:
|
if not cat_class:
|
||||||
|
|
|
@ -1047,7 +1047,7 @@ def do_funcdesc(length, buf, pp, i):
|
||||||
hist.inargs = save
|
hist.inargs = save
|
||||||
del save
|
del save
|
||||||
the_args = [chunk(PLAIN, wh, '()'[0])] + pp[i:newi] + \
|
the_args = [chunk(PLAIN, wh, '()'[0])] + pp[i:newi] + \
|
||||||
[chunk(PLAIN, wh, '()'[1])]
|
[chunk(PLAIN, wh, '()'[1])]
|
||||||
del pp[i:newi]
|
del pp[i:newi]
|
||||||
length = length - (newi-i)
|
length = length - (newi-i)
|
||||||
|
|
||||||
|
@ -1157,9 +1157,9 @@ def do_datadesc(length, buf, pp, i):
|
||||||
cat_class = 'data'
|
cat_class = 'data'
|
||||||
class_class = string.join(idxsi[2:])
|
class_class = string.join(idxsi[2:])
|
||||||
|
|
||||||
|
|
||||||
if not command:
|
if not command:
|
||||||
raise error, 'don\'t know what to do with indexsubitem ' + `idxsi`
|
return length, i
|
||||||
|
#raise error, 'don\'t know what to do with indexsubitem ' + `idxsi` *)
|
||||||
|
|
||||||
ch.chtype = chunk_type[CSLINE]
|
ch.chtype = chunk_type[CSLINE]
|
||||||
ch.data = command
|
ch.data = command
|
||||||
|
@ -1522,8 +1522,11 @@ def changeit(buf, pp):
|
||||||
elif len(idxsi) >= 2 and idxsi[1] in \
|
elif len(idxsi) >= 2 and idxsi[1] in \
|
||||||
('exception', 'object'):
|
('exception', 'object'):
|
||||||
command = 'vindex'
|
command = 'vindex'
|
||||||
|
elif len(idxsi) == 3 and idxsi[:2] == ['in', 'module']:
|
||||||
|
command = 'cindex'
|
||||||
else:
|
else:
|
||||||
print 'WARNING: can\'t categorize ' + `idxsi` + ' for \'ttindex\' command'
|
print 'WARNING: can\'t categorize ' + `idxsi` \
|
||||||
|
+ ' for \'ttindex\' command'
|
||||||
command = 'cindex'
|
command = 'cindex'
|
||||||
|
|
||||||
if not cat_class:
|
if not cat_class:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue