Commit 8ac508eb authored by Marco Clemencic's avatar Marco Clemencic
Browse files
parent 05538d04
...@@ -117,14 +117,16 @@ def checkEncoding(fileObj): ...@@ -117,14 +117,16 @@ def checkEncoding(fileObj):
## Make a zip file out of a directory containing python modules ## Make a zip file out of a directory containing python modules
def zipdir(directory, no_pyc = False): def zipdir(directory, no_pyc = False):
filename = os.path.realpath(directory + ".zip")
log = logging.getLogger("zipdir") log = logging.getLogger("zipdir")
if not os.path.isdir(directory): if not os.path.isdir(directory):
raise OSError(20, "Not a directory", directory) log.warning('directory %s missing, creating empty .zip file', directory)
open(filename, "ab").close()
return
msg = "Zipping directory '%s'" msg = "Zipping directory '%s'"
if no_pyc: if no_pyc:
msg += " (without pre-compilation)" msg += " (without pre-compilation)"
log.info(msg, directory) log.info(msg, directory)
filename = os.path.realpath(directory + ".zip")
# Open the file in read an update mode # Open the file in read an update mode
if os.path.exists(filename): if os.path.exists(filename):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment