aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-02-15 18:13:06 +0000
committerDaniel P. Berrange <berrange@redhat.com>2017-02-15 18:13:06 +0000
commit0d90289be03d82c82f7b313e4b4864d31439bdb2 (patch)
treeed4ebc409496acd159968248e3e46ba735d2a576
parentb87eafb43b1bda6c09048db3bf3ba1cb4feee789 (diff)
downloadkeycodemapdb-0d90289be03d82c82f7b313e4b4864d31439bdb2.zip
keycodemapdb-0d90289be03d82c82f7b313e4b4864d31439bdb2.tar.gz
keycodemapdb-0d90289be03d82c82f7b313e4b4864d31439bdb2.tar.bz2
Don't call next() method in CSV reader
The next() method was renamed in python3. Simply avoid calling it to ensure portability Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
-rwxr-xr-xtools/keymap-gen10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/keymap-gen b/tools/keymap-gen
index 5dc7d3d..3ed4b99 100755
--- a/tools/keymap-gen
+++ b/tools/keymap-gen
@@ -143,13 +143,17 @@ class Database:
def load(self, filename):
self._generate_checksum(filename)
- with open(filename, 'rb') as f:
+ with open(filename, 'r') as f:
reader = csv.reader(f)
- # Discard column headings
- reader.next()
+ first = True
for row in reader:
+ # Discard column headings
+ if first:
+ first = False
+ continue
+
# We special case MAP_LINUX since that is out
# master via which all other mappings are done
linux = self.load_linux(row)