diff options
| author | Sebastian Thiel <byronimo@gmail.com> | 2014-11-13 09:00:44 +0100 |
|---|---|---|
| committer | Sebastian Thiel <byronimo@gmail.com> | 2014-11-13 09:00:44 +0100 |
| commit | 85dde34bc724570617f3df1cdc40ba1b0942c77e (patch) | |
| tree | 4d60b1dd22a5c78688c437dabe68381bb11c4b1f /gitdb/util.py | |
| parent | 81707c606b88e971cc359e3e9f3abeeea2204860 (diff) | |
| download | gitdb-85dde34bc724570617f3df1cdc40ba1b0942c77e.tar.gz | |
Minor adjustments to adapt to changes in async (due to be removed anyway)
Diffstat (limited to 'gitdb/util.py')
| -rw-r--r-- | gitdb/util.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gitdb/util.py b/gitdb/util.py index 1662b66..75f6bb9 100644 --- a/gitdb/util.py +++ b/gitdb/util.py @@ -7,27 +7,22 @@ import os import mmap import sys import errno - -from cStringIO import StringIO +import stat # in py 2.4, StringIO is only StringI, without write support. # Hence we must use the python implementation for this if sys.version_info[1] < 5: from StringIO import StringIO +else: + from cStringIO import StringIO # END handle python 2.4 -try: - import async.mod.zlib as zlib -except ImportError: - import zlib -# END try async zlib - from async import ThreadPool from smmap import ( - StaticWindowMapManager, - SlidingWindowMapManager, - SlidingWindowMapBuffer - ) + StaticWindowMapManager, + SlidingWindowMapManager, + SlidingWindowMapBuffer + ) # initialize our global memory manager instance # Use it to free cached (and unused) resources. @@ -304,7 +299,7 @@ class LockedFD(object): binary = getattr(os, 'O_BINARY', 0) lockmode = os.O_WRONLY | os.O_CREAT | os.O_EXCL | binary try: - fd = os.open(self._lockfilepath(), lockmode, 0600) + fd = os.open(self._lockfilepath(), lockmode, stat.S_IREAD|stat.S_IWRITE) if not write: os.close(fd) else: @@ -373,7 +368,7 @@ class LockedFD(object): # assure others can at least read the file - the tmpfile left it at rw-- # We may also write that file, on windows that boils down to a remove- # protection as well - chmod(self._filepath, 0644) + chmod(self._filepath, stat.S_IREAD|stat.S_IWRITE|stat.S_IRGRP|stat.S_IROTH) else: # just delete the file so far, we failed os.remove(lockfile) |
