get_unicode_path_from_env_var(): make no-op if it's already unicode
svn: r21561
This commit is contained in:
parent
2dcc870dbc
commit
b262eeaab7
@ -141,6 +141,10 @@ def get_unicode_path_from_env_var(path):
|
|||||||
:rtype: unicode
|
:rtype: unicode
|
||||||
:returns: The Unicode version of path.
|
: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'
|
# make only unicode of path of type 'str'
|
||||||
if not (isinstance(path, str)):
|
if not (isinstance(path, str)):
|
||||||
raise TypeError("path %s isn't a str" % str(path))
|
raise TypeError("path %s isn't a str" % str(path))
|
||||||
|
Loading…
Reference in New Issue
Block a user