summaryrefslogtreecommitdiff
path: root/gitdb/db/loose.py
diff options
context:
space:
mode:
authorKevin Brown <kevin@kevinbrown.in>2014-07-13 15:41:15 -0400
committerKevin Brown <kevin@kevinbrown.in>2014-07-13 15:41:15 -0400
commitb6c493deb2341fb843d71b66b2aa23078638755c (patch)
treedb4695c1056b41136180c9cef8fdf4342e499862 /gitdb/db/loose.py
parent1c6f4c19289732bd13507eba9e54c9d692957137 (diff)
downloadgitdb-b6c493deb2341fb843d71b66b2aa23078638755c.tar.gz
Pick off the low hanging fruit
This fixes most of the import errors that came from using the implicit relative imports that Python 2 supports. This also fixes the use of `xrange`, which has replaced `range` in Python 3. The same has happened for `izip`, which is also being aliased. The octal number syntax changed in Python 3, so we are now converting from strings using the `int` built-in function, which will produce the same output across both versions of Python.
Diffstat (limited to 'gitdb/db/loose.py')
-rw-r--r--gitdb/db/loose.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/gitdb/db/loose.py b/gitdb/db/loose.py
index 4ebca84..ac1b9d1 100644
--- a/gitdb/db/loose.py
+++ b/gitdb/db/loose.py
@@ -2,11 +2,11 @@
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
-from base import (
- FileDBBase,
- ObjectDBR,
- ObjectDBW
- )
+from gitdb.db.base import (
+ FileDBBase,
+ ObjectDBR,
+ ObjectDBW
+)
from gitdb.exc import (
@@ -69,11 +69,11 @@ class LooseObjectDB(FileDBBase, ObjectDBR, ObjectDBW):
# On windows we need to keep it writable, otherwise it cannot be removed
# either
- new_objects_mode = 0444
+ new_objects_mode = int("444", 8)
if os.name == 'nt':
- new_objects_mode = 0644
-
-
+ new_objects_mode = int("644", 8)
+
+
def __init__(self, root_path):
super(LooseObjectDB, self).__init__(root_path)
self._hexsha_to_file = dict()
@@ -133,7 +133,7 @@ class LooseObjectDB(FileDBBase, ObjectDBR, ObjectDBW):
db_path = self.db_path(self.object_path(bin_to_hex(sha)))
try:
return file_contents_ro_filepath(db_path, flags=self._fd_open_flags)
- except OSError,e:
+ except OSError as e:
if e.errno != ENOENT:
# try again without noatime
try: