Skip to content

Commit 7533ffb

Browse files
author
Stefan Oderbolz
committed
Fix linting errors
1 parent c4887e8 commit 7533ffb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/library_of_congress.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import sruthi
2+
import sys
23

34
LOC_BASE = 'http://lx2.loc.gov:210/LCDB?'
45

6+
57
def loc_search(isbn, sru_base):
68
loc_lcc = None
79
try:
@@ -14,10 +16,12 @@ def loc_search(isbn, sru_base):
1416
if len(field.get('subfield', [])) > 0:
1517
loc_lcc = (field['subfield'][0]['text'])
1618
break
17-
except:
19+
except Exception as e:
20+
print("Error: %s" % e, file=sys.stderr)
1821
return None
1922
return loc_lcc
2023

24+
2125
isbn = '0062509470'
2226
result = loc_search(isbn, LOC_BASE)
2327
print(f"Tag 050 of ISBN '{isbn}': {result}")

0 commit comments

Comments
 (0)