tweaks to handle objc.pyobc_unicode (NSString) correctly

git-svn-id: http://munki.googlecode.com/svn/trunk@946 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
John Randolph
2010-12-01 20:33:15 +00:00
parent 3d8d960bb1
commit 5c4e7ca51b
+2 -2
View File
@@ -1586,7 +1586,7 @@ def listdir(path):
"""OSX HFS+ string encoding safe listdir().
Args:
path: str or unicode, path to list contents of
path: path to list contents of
Returns:
list of contents, items as str or unicode types
"""
@@ -1605,7 +1605,7 @@ def listdir(path):
if type(path) is str:
path = unicode(path, 'utf-8')
elif type(path) is not unicode:
raise TypeError('path (%s) should be unicode or str' % str(path))
path = unicode(path)
return os.listdir(path)