Skip to content

Commit

Permalink
BibMatch: fix Python-2.4 incompatibilities
Browse files Browse the repository at this point in the history
* Fixes the way InvenioConnectorAuthError exceptions were handled
  in 9ecb174 to comply with
  Python 2.4 syntax.  (closes #715)
  • Loading branch information
jalavik authored and tiborsimko committed Jun 28, 2011
1 parent 62eaad1 commit 588b77e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions modules/bibmatch/lib/bibmatch_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,10 @@ def match_records(records, qrystrs=None, search_mode=None, operator="and", verbo

try:
server = InvenioConnector(server_url, user=user, password=password)
except InvenioConnectorAuthError as error:
except InvenioConnectorAuthError, error:
if verbose > 0:
sys.stderr.write(str(error))
sys.stderr.write("Authentication error when connecting to server: %s" \
% (str(error),))
return [newrecs, matchedrecs, ambiguousrecs, fuzzyrecs]

## Go through each record and try to find matches using defined querystrings
Expand Down Expand Up @@ -606,9 +607,10 @@ def match_records(records, qrystrs=None, search_mode=None, operator="and", verbo
## Perform the search with retries
try:
result_recids = server.search_with_retry(**search_params)
except InvenioConnectorAuthError as error:
except InvenioConnectorAuthError, error:
if verbose > 0:
sys.stderr.write(str(error))
sys.stderr.write("Authentication error when searching: %s" \
% (str(error),))
break
if (verbose > 8):
if len(result_recids) > 10:
Expand Down Expand Up @@ -662,9 +664,10 @@ def match_records(records, qrystrs=None, search_mode=None, operator="and", verbo
search_params = dict(p=qry, f=field, of='id', c=collections)
try:
current_resultset = server.search_with_retry(**search_params)
except InvenioConnectorAuthError as error:
except InvenioConnectorAuthError, error:
if (verbose > 0):
sys.stderr.write(str(error))
sys.stderr.write("Authentication error when searching: %s" \
% (str(error),))
break
if (verbose > 8):
if len(current_resultset) > 10:
Expand Down

0 comments on commit 588b77e

Please sign in to comment.