From 49ce32b403e80ba4e4fb6e583707f26df98a6ef9 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 3 Mar 2021 18:42:38 +0100 Subject: [PATCH] Fix a minor python2/python3 compatibility issue on MSW --- scripting/kicadplugins.i | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripting/kicadplugins.i b/scripting/kicadplugins.i index 6b5de807de..8bc0eda619 100644 --- a/scripting/kicadplugins.i +++ b/scripting/kicadplugins.i @@ -76,12 +76,24 @@ FULL_BACK_TRACE="" def GetUnLoadableWizards(): global NOT_LOADED_WIZARDS - utf8_str = NOT_LOADED_WIZARDS.encode( 'UTF-8' ) + import sys + + if sys.version_info[0] < 3: + utf8_str = NOT_LOADED_WIZARDS.encode( 'UTF-8' ) + else: + utf8_str = NOT_LOADED_WIZARDS + return utf8_str def GetWizardsSearchPaths(): global PLUGIN_DIRECTORIES_SEARCH - utf8_str = PLUGIN_DIRECTORIES_SEARCH.encode( 'UTF-8' ) + import sys + + if sys.version_info[0] < 3: + utf8_str = PLUGIN_DIRECTORIES_SEARCH.encode( 'UTF-8' ) + else: + utf8_str = PLUGIN_DIRECTORIES_SEARCH + return utf8_str def GetWizardsBackTrace():