From 68966f414cab552efaf854300d25839b5dbca87e Mon Sep 17 00:00:00 2001 From: Ian Mackinnon Date: Fri, 19 Oct 2012 17:12:07 +0200 Subject: [PATCH] Better header error reporting. --- Makefile | 2 ++ ale.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7fc9946..1daecae 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/ale.py b/ale.py index b7c332c..374fb84 100644 --- a/ale.py +++ b/ale.py @@ -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]