From b262eeaab7b8f4c6b6a6e7731bfbc58357a1d88b Mon Sep 17 00:00:00 2001 From: John Ralls Date: Wed, 6 Mar 2013 01:07:05 +0000 Subject: [PATCH] get_unicode_path_from_env_var(): make no-op if it's already unicode svn: r21561 --- gramps/gen/utils/file.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gramps/gen/utils/file.py b/gramps/gen/utils/file.py index 1103c6828..a68952507 100644 --- a/gramps/gen/utils/file.py +++ b/gramps/gen/utils/file.py @@ -141,6 +141,10 @@ def get_unicode_path_from_env_var(path): :rtype: unicode :returns: The Unicode version of path. """ + #No need to do anything if it's already unicode + if isinstance(path, UNITYPE): + return path + # make only unicode of path of type 'str' if not (isinstance(path, str)): raise TypeError("path %s isn't a str" % str(path))