From 37bb76947056cee5c274bd9aa9715be244f08f44 Mon Sep 17 00:00:00 2001 From: Justin Abene Date: Mon, 20 Aug 2018 00:42:07 -0400 Subject: [PATCH] Prevent "cannot use a string pattern on a bytes-like object" Fixes #21207 (cherry picked from commit c6a4ca5c9e8c7c9c4c3fd3140bf8b1fc97f5cbfc) --- modules/mono/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/mono/config.py b/modules/mono/config.py index 3fcc6354b38..0b06824b006 100644 --- a/modules/mono/config.py +++ b/modules/mono/config.py @@ -264,11 +264,13 @@ def pkgconfig_try_find_mono_root(mono_lib_names, sharedlib_ext): def pkgconfig_try_find_mono_version(): + from compat import decode_utf8 + lines = subprocess.check_output(['pkg-config', 'monosgen-2', '--modversion']).splitlines() greater_version = None for line in lines: try: - version = LooseVersion(line) + version = LooseVersion(decode_utf8(line)) if greater_version is None or version > greater_version: greater_version = version except ValueError: