diff options
author | Johannes Berg <johannes.berg@intel.com> | 2019-08-22 21:46:27 +0200 |
---|---|---|
committer | Seth Forshee <seth.forshee@canonical.com> | 2019-10-29 08:50:53 -0500 |
commit | 651e39dee8605995b736b6056c6f7dc5c5a9c948 (patch) | |
tree | 4826ad615b8d5db5270d139a8eb0f0b3f3a455a9 /dbparse.py | |
parent | 91b2b6795cb39e77145617aab2f591abf16582f1 (diff) | |
download | external_wireless-regdb-651e39dee8605995b736b6056c6f7dc5c5a9c948.tar.gz external_wireless-regdb-651e39dee8605995b736b6056c6f7dc5c5a9c948.tar.bz2 external_wireless-regdb-651e39dee8605995b736b6056c6f7dc5c5a9c948.zip |
regdb: fix compatibility with python2
Various changes in the commit mentioned below broke
compatibility with python2. Restore it in a way that
makes it worth with both versions.
Fixes: f3c4969c2485 ("wireless-regdb: make scripts compatible with Python 3")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Diffstat (limited to 'dbparse.py')
-rwxr-xr-x | dbparse.py | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1,6 +1,5 @@ #!/usr/bin/env python -from builtins import bytes from functools import total_ordering import sys, math from math import ceil, log @@ -359,7 +358,7 @@ class DBParser(object): for cname in cnames: if len(cname) != 2: self._warn("country '%s' not alpha2" % cname) - cname = bytes(cname, 'ascii') + cname = cname.encode('ascii') if not cname in self._countries: self._countries[cname] = Country(dfs_region, comments=self._comments) self._current_countries[cname] = self._countries[cname] |