Skip to content

Commit

Permalink
Better header error reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmackinnon committed Oct 19, 2012
1 parent 4ec824b commit 68966f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ all :
package : ale.py MANIFEST.in README.md setup.py
python setup.py sdist

dist/ALE-0.1dev.tar.gz : package

install : dist/ALE-0.1dev.tar.gz
sudo pip install dist/ALE-0.1dev.tar.gz

Expand Down
5 changes: 4 additions & 1 deletion ale.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ class ale(object):
delim = "\t"

def _read_heading(self, line):
key, value = line.split(self.delim)[:2]
try:
key, value = line.split(self.delim)[:2]
except ValueError as e:
raise ValueError("Expected two values separated by a tab: '%s'", repr(line))
if not key in headings:
raise ValueError("Unknown heading: '%s'.", key)
heading = headings[key]
Expand Down

0 comments on commit 68966f4

Please sign in to comment.