Commits

tush committed a6b3d77

Исправления совместимости с python2.6

  • Participants
  • Parent commits 6565e2d

Comments (0)

Files changed (1)

File generate_data.py

         from urllib2 import urlopen
     from contextlib import closing
 
-    with closing(urlopen(remote)) as inf, open(local, "wb") as ouf:
-        while True:
-            data = inf.read()
-            if not data:
-                break
-            ouf.write(data)
+    with closing(urlopen(remote)) as inf:
+        with open(local, "wb") as ouf:
+            while True:
+                data = inf.read()
+                if not data:
+                    break
+                ouf.write(data)
 
 
 def build_blocks():