提交 e39a7cd2 编写于 作者: C Cole Robinson

apibuild: Fix -refs.xml building

Another usage of deprecated 'string' functions. We are just trying to
match ascii letters here, so use a simple regex. And again drop the
aggressive exception handling, it doesn't seem to trigger for anything
in libvirt code.
Signed-off-by: NCole Robinson <crobinso@redhat.com>
上级 960ff97b
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
from __future__ import print_function from __future__ import print_function
import os, sys import os, sys
import string
import glob import glob
import re import re
...@@ -2092,14 +2091,13 @@ class docBuilder: ...@@ -2092,14 +2091,13 @@ class docBuilder:
str = str.replace(';', ' ') str = str.replace(';', ' ')
tokens = str.split() tokens = str.split()
for token in tokens: for token in tokens:
try:
c = token[0] c = token[0]
if string.letters.find(c) < 0: if not re.match(r"[a-zA-Z]", c):
pass pass
elif len(token) < 3: elif len(token) < 3:
pass pass
else: else:
lower = string.lower(token) lower = token.lower()
# TODO: generalize this a bit # TODO: generalize this a bit
if lower == 'and' or lower == 'the': if lower == 'and' or lower == 'the':
pass pass
...@@ -2107,8 +2105,6 @@ class docBuilder: ...@@ -2107,8 +2105,6 @@ class docBuilder:
self.xref[token].append(id) self.xref[token].append(id)
else: else:
self.xref[token] = [id] self.xref[token] = [id]
except:
pass
def analyze(self): def analyze(self):
if not quiet: if not quiet:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册