[r21561]get_unicode_path_from_env_var(): make no-op if it's already unicode

svn: r21563
This commit is contained in:
John Ralls 2013-03-06 01:12:07 +00:00
parent 2dee2c4d77
commit 992b161798

View File

@ -135,6 +135,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))