[r21561]get_unicode_path_from_env_var(): make no-op if it's already unicode
svn: r21563
This commit is contained in:
parent
2dee2c4d77
commit
992b161798
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user