File: smart_arse_fix.patch

package info (click to toggle)
python-biom-format 2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,548 kB
  • ctags: 1,051
  • sloc: python: 6,257; makefile: 137; sh: 52
file content (21 lines) | stat: -rw-r--r-- 820 bytes parent folder | download
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: