Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 1 | From 168ac446cdd9a1b59d6b708360a9556515ba56b9 Mon Sep 17 00:00:00 2001 |
| 2 | From: MilhouseVH <milhouseVH.github@nmacleod.com> |
| 3 | Date: Sun, 16 Feb 2020 09:41:43 +0000 |
| 4 | Subject: [PATCH] fix python3 support |
| 5 | |
| 6 | https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/issues/197 |
| 7 | |
| 8 | Upstream-Status: Backport |
| 9 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| 10 | --- |
| 11 | rules/compat/map-variants.py | 6 +++--- |
| 12 | 1 file changed, 3 insertions(+), 3 deletions(-) |
| 13 | |
| 14 | diff --git a/rules/compat/map-variants.py b/rules/compat/map-variants.py |
| 15 | index ebbfec9..979ba43 100755 |
| 16 | --- a/rules/compat/map-variants.py |
| 17 | +++ b/rules/compat/map-variants.py |
| 18 | @@ -1,4 +1,4 @@ |
| 19 | -#!/usr/bin/python3 |
| 20 | +#!/usr/bin/env python3 |
| 21 | |
| 22 | import argparse |
| 23 | import re |
| 24 | @@ -12,8 +12,8 @@ class Layout(object): |
| 25 | assert variant is None |
| 26 | # parse a layout(variant) string |
| 27 | match = re.match(r'([^(]+)\(([^)]+)\)', layout) |
| 28 | - self.layout = match[1] |
| 29 | - self.variant = match[2] |
| 30 | + self.layout = match.groups()[0] |
| 31 | + self.variant = match.groups()[1] |
| 32 | |
| 33 | def __str__(self): |
| 34 | if self.variant: |