Issue 4291, wrong path when cancel.
svn: r15975
This commit is contained in:
@ -333,12 +333,12 @@ def get_unicode_path_from_file_chooser(path):
|
|||||||
:rtype: unicode
|
:rtype: unicode
|
||||||
:returns: The Unicode version of path.
|
:returns: The Unicode version of path.
|
||||||
"""
|
"""
|
||||||
# Don't make unicode of unicode
|
# make omly unicode of path of type 'str'
|
||||||
if isinstance(path, unicode):
|
if not (isinstance(path, str)):
|
||||||
return path
|
return path
|
||||||
|
|
||||||
if constfunc.win():
|
if constfunc.win():
|
||||||
# in windows filechooser returns officially utf-8, not filesystemencoding
|
# in windows filechooser returns officially utf-8, not filesystemencoding
|
||||||
try:
|
try:
|
||||||
return unicode(path)
|
return unicode(path)
|
||||||
except:
|
except:
|
||||||
@ -360,7 +360,8 @@ def get_unicode_path_from_env_var(path):
|
|||||||
:rtype: unicode
|
:rtype: unicode
|
||||||
:returns: The Unicode version of path.
|
:returns: The Unicode version of path.
|
||||||
"""
|
"""
|
||||||
if isinstance(path, unicode):
|
# make omly unicode of path of type 'str'
|
||||||
|
if not (isinstance(path, str)):
|
||||||
return path
|
return path
|
||||||
|
|
||||||
if constfunc.win():
|
if constfunc.win():
|
||||||
|
Reference in New Issue
Block a user