Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7edd8d3

Browse files
committed
(partparse.py): Rationalize some behavior around unexpected conditions.
1 parent e1980ed commit 7edd8d3

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

Doc/partparse.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ def do_funcdesc(length, buf, pp, i):
10471047
hist.inargs = save
10481048
del save
10491049
the_args = [chunk(PLAIN, wh, '()'[0])] + pp[i:newi] + \
1050-
[chunk(PLAIN, wh, '()'[1])]
1050+
[chunk(PLAIN, wh, '()'[1])]
10511051
del pp[i:newi]
10521052
length = length - (newi-i)
10531053

@@ -1157,9 +1157,9 @@ def do_datadesc(length, buf, pp, i):
11571157
cat_class = 'data'
11581158
class_class = string.join(idxsi[2:])
11591159

1160-
11611160
if not command:
1162-
raise error, 'don\'t know what to do with indexsubitem ' + `idxsi`
1161+
return length, i
1162+
#raise error, 'don\'t know what to do with indexsubitem ' + `idxsi` *)
11631163

11641164
ch.chtype = chunk_type[CSLINE]
11651165
ch.data = command
@@ -1522,8 +1522,11 @@ def changeit(buf, pp):
15221522
elif len(idxsi) >= 2 and idxsi[1] in \
15231523
('exception', 'object'):
15241524
command = 'vindex'
1525+
elif len(idxsi) == 3 and idxsi[:2] == ['in', 'module']:
1526+
command = 'cindex'
15251527
else:
1526-
print 'WARNING: can\'t categorize ' + `idxsi` + ' for \'ttindex\' command'
1528+
print 'WARNING: can\'t categorize ' + `idxsi` \
1529+
+ ' for \'ttindex\' command'
15271530
command = 'cindex'
15281531

15291532
if not cat_class:

Doc/tools/partparse.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ def do_funcdesc(length, buf, pp, i):
10471047
hist.inargs = save
10481048
del save
10491049
the_args = [chunk(PLAIN, wh, '()'[0])] + pp[i:newi] + \
1050-
[chunk(PLAIN, wh, '()'[1])]
1050+
[chunk(PLAIN, wh, '()'[1])]
10511051
del pp[i:newi]
10521052
length = length - (newi-i)
10531053

@@ -1157,9 +1157,9 @@ def do_datadesc(length, buf, pp, i):
11571157
cat_class = 'data'
11581158
class_class = string.join(idxsi[2:])
11591159

1160-
11611160
if not command:
1162-
raise error, 'don\'t know what to do with indexsubitem ' + `idxsi`
1161+
return length, i
1162+
#raise error, 'don\'t know what to do with indexsubitem ' + `idxsi` *)
11631163

11641164
ch.chtype = chunk_type[CSLINE]
11651165
ch.data = command
@@ -1522,8 +1522,11 @@ def changeit(buf, pp):
15221522
elif len(idxsi) >= 2 and idxsi[1] in \
15231523
('exception', 'object'):
15241524
command = 'vindex'
1525+
elif len(idxsi) == 3 and idxsi[:2] == ['in', 'module']:
1526+
command = 'cindex'
15251527
else:
1526-
print 'WARNING: can\'t categorize ' + `idxsi` + ' for \'ttindex\' command'
1528+
print 'WARNING: can\'t categorize ' + `idxsi` \
1529+
+ ' for \'ttindex\' command'
15271530
command = 'cindex'
15281531

15291532
if not cat_class:

0 commit comments

Comments
 (0)