psycopg2 fix for github issue 4

This commit is contained in:
David Halter
2012-09-03 01:02:38 +02:00
parent e18361d161
commit c9fb482480
2 changed files with 12 additions and 0 deletions

View File

@@ -386,6 +386,9 @@ def parse_function_doc(func):
# get result type, which can contain newlines
pattern = re.compile(r'(,\n|[^\n-])+')
ret_str = pattern.match(doc, index + 3).group(0).strip()
# New object -> object()
ret_str = re.sub(r'[nN]ew (.*)', r'\1()', ret_str)
ret = Parser.map_types.get(ret_str, ret_str)
if ret == ret_str and ret not in ['None', 'object', 'tuple', 'set']:
debug.dbg('not working', ret_str)