aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-02-04 20:26:43 +0700
committerSergey M <dstftw@gmail.com>2017-02-19 05:10:08 +0800
commit18a0defab063523cd76a30be2dd5a80e9f9172d6 (patch)
treeba8e13690688a57d66e9928c11b1b7bc3d0d25ef
parent5d3fbf77d96ade64c645b6942979c0b99aa4d775 (diff)
[utils] Make random_ipv4 return unicode string
-rw-r--r--youtube_dl/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 4e76b6b7b..cbf7639c5 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -3290,8 +3290,8 @@ class GeoUtils(object):
addr, preflen = block.split('/')
addr_min = compat_struct_unpack('!L', socket.inet_aton(addr))[0]
addr_max = addr_min | (0xffffffff >> int(preflen))
- return socket.inet_ntoa(
- compat_struct_pack('!I', random.randint(addr_min, addr_max)))
+ return compat_str(socket.inet_ntoa(
+ compat_struct_pack('!I', random.randint(addr_min, addr_max))))
class PerRequestProxyHandler(compat_urllib_request.ProxyHandler):