Permalink
Browse files

Fix race condition which caused an error in unpacking.

  • Loading branch information...
1 parent 80a2ae3 commit da556c902f8fba0fe8cbbf7c53e5545e8feba3ab Alexei Boronine committed Aug 1, 2010
Showing with 3 additions and 6 deletions.
  1. +3 −6 pypyenv.py
View
@@ -7,7 +7,7 @@
import getopt
import platform
-__version__ = "0.1"
+__version__ = "0.1.1"
base = sys.prefix
srcdir = "src"
@@ -42,18 +42,15 @@ def install(download):
if not data:
break
archivefile.write(data)
+ archivefile.close()
# Unpack archive
archiveobj = tarfile.open(archive, mode="r:bz2")
unpacked = os.path.join(srcdir, archiveobj.next().name)
if os.path.exists(unpacked):
out("deleting ENV/%s" % unpacked)
shutil.rmtree(unpacked)
out("unpacking archive")
- try:
- archiveobj.extractall(srcdir)
- except EOFError:
- # FIXME: Investigate why this sometimes only works on the second try
- archiveobj.extractall(srcdir)
+ archiveobj.extractall(srcdir)
# Copying PyPy directory into virtualenv root
out("copying PyPy directory into root")
shutil.copytree(unpacked, pypydir)

0 comments on commit da556c9

Please sign in to comment.