diff options
author | Philipp Hagemeister <[email protected]> | 2012-11-27 18:48:43 +0100 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2012-11-27 18:48:43 +0100 |
commit | 1a9c655e3b1569f315d4193e877cba0b4a863c63 (patch) | |
tree | 968dd94d28dbc88532f73a97a67c3fa73e107039 /youtube_dl/utils.py | |
parent | 88db5ef279e2cb4679b049ef3f002a3856609010 (diff) | |
parent | bae611f216ac7b1f1a24a506da6dffc518d09d5b (diff) | |
download | youtube-dl-1a9c655e3b1569f315d4193e877cba0b4a863c63.tar.gz youtube-dl-1a9c655e3b1569f315d4193e877cba0b4a863c63.zip |
Merge remote-tracking branch 'Asido/master'
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index a0c41081a..40d6823a0 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -37,15 +37,13 @@ def preferredencoding(): Returns the best encoding scheme for the system, based on locale.getpreferredencoding() and some further tweaks. """ - def yield_preferredencoding(): - try: - pref = locale.getpreferredencoding() - u'TEST'.encode(pref) - except: - pref = 'UTF-8' - while True: - yield pref - return yield_preferredencoding().next() + try: + pref = locale.getpreferredencoding() + u'TEST'.encode(pref) + except: + pref = 'UTF-8' + + return pref def htmlentity_transform(matchobj): |