Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
gotta use tempfile.mktemp
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Groszer committed Jun 15, 2010
1 parent 6e02a74 commit 259f8ea
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/zope/wineggbuilder/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ def build(self, package, version, files, sourceFolder):

LOGGER.debug('Running: %s\nIn: %s', command, sourceFolder)

tmpfile = None
if len(command.splitlines()) > 1:
#in case there are more lines we got to do .bat file
tmpfile = tempfile.NamedTemporaryFile(suffix='.bat')
tmpfile.write(command)
tmpfile.file.flush()
command = tmpfile.name
tmpfile = tempfile.mktemp(suffix='.bat')
open(tmpfile, "w").write(command)
command = tmpfile

try:
#this ought to build and upload the egg
Expand All @@ -104,6 +104,9 @@ def build(self, package, version, files, sourceFolder):
LOGGER.exception("An error occurred while running the build command")
#continue without bailing out

if tmpfile:
os.remove(tmpfile)

def versionToTuple(version):
#tries to do "3.4.0" -> ('0003','0004','0000')
#otherwise the problem starts with 3.10.0, that would be less than 3.4.0
Expand Down

0 comments on commit 259f8ea

Please sign in to comment.