From 023d3f5bc4c5d2f7929c63bea9eb0cfc6fa44103 Mon Sep 17 00:00:00 2001 From: Fedor Baart Date: Wed, 4 May 2016 16:38:25 +0200 Subject: [PATCH] fix matplotlib unicode rcparams --- bbfreeze/recipes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bbfreeze/recipes.py b/bbfreeze/recipes.py index 67f41db..ff32233 100644 --- a/bbfreeze/recipes.py +++ b/bbfreeze/recipes.py @@ -234,7 +234,9 @@ def recipe_matplotlib(mf): mf.copyTree(dp, "matplotlibdata", m) mf.import_hook("matplotlib.numerix.random_array", m) - backend_name = 'backend_' + matplotlib.get_backend().lower() + # the import hook expects a string (matplotlib in later versions has + # all rcParams, including the backend as unicode) + backend_name = 'backend_' + str(matplotlib.get_backend().lower()) print "recipe_matplotlib: using the %s matplotlib backend" % (backend_name, ) mf.import_hook('matplotlib.backends.' + backend_name, m) return True