1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
Author: Tim Booth <tbooth@ceh.ac.uk>
Last-Update: Fri, 28 Feb 2014 16:25:41 +0000
Description: Deal with cases when h_key xor h_value is set
--- a/biom/table.py
+++ b/biom/table.py
@@ -338,12 +338,8 @@ class Table(object):
samp_ids = delim.join(map(str, self.SampleIds))
- # 17 hrs of straight programming later...
- if header_key is not None:
- if header_value is None:
- raise TableException, "You need to specify both header_key and header_value"
- if header_value is not None:
- if header_key is None:
+ # If h_key xor h_value is set we have a problem...
+ if (header_key is None) != (header_value is None):
raise TableException, "You need to specify both header_key and header_value"
if header_value:
|