[downloader/common] Do not use classic int division
authorPhilipp Hagemeister <phihag@phihag.de>
Fri, 12 Dec 2014 16:17:09 +0000 (17:17 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Fri, 12 Dec 2014 16:17:09 +0000 (17:17 +0100)
youtube_dl/downloader/common.py

index 6e44c88c9f980472c54d25efadb33de7264927f6..2a566eabe5ecb564ff1f102dd100c1798a26d436 100644 (file)
@@ -160,7 +160,7 @@ class FileDownloader(object):
             return
         speed = float(byte_counter) / elapsed
         if speed > rate_limit:
-            time.sleep(max((byte_counter / rate_limit) - elapsed, 0))
+            time.sleep(max((byte_counter // rate_limit) - elapsed, 0))
 
     def temp_name(self, filename):
         """Returns a temporary filename for the given filename."""