aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-11-27 18:48:43 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-11-27 18:48:43 +0100
commit1a9c655e3b1569f315d4193e877cba0b4a863c63 (patch)
tree968dd94d28dbc88532f73a97a67c3fa73e107039 /youtube_dl
parent88db5ef279e2cb4679b049ef3f002a3856609010 (diff)
parentbae611f216ac7b1f1a24a506da6dffc518d09d5b (diff)
Merge remote-tracking branch 'Asido/master'
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/utils.py16
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):