Skip to content

Commit

Permalink
Make the parser error visible and use a(n uneaten) copy of self.line.
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Higgins committed Jun 5, 2012
1 parent 4301c3b commit c74feee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rdflib/plugins/parsers/nquads.py
Expand Up @@ -69,11 +69,12 @@ def parse(self, inputsource, sink, **kwargs):
self.file = source
self.buffer = ''
while True:
self.line = self.readline()
self.line = __line = self.readline()
if self.line is None: break
try: self.parseline()
except ParseError:
raise ParseError("Invalid line: %r" % self.line)
except ParseError, msg:
raise ParseError("Invalid line (%s):\n%r" % (msg, __line))

return self.sink

def context(self):
Expand Down

0 comments on commit c74feee

Please sign in to comment.