diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-04 19:50:28 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-04 19:50:28 +0100 |
commit | ae2ff0f9d704dc776a1934f72a339da206a9fff4 (patch) | |
tree | 53b7cb30f47c60bdf38d824f1c729191d1f1f2d9 /git/refs | |
parent | f6aa8d116eb33293c0a9d6d600eb7c32832758b9 (diff) | |
download | gitpython-ae2ff0f9d704dc776a1934f72a339da206a9fff4.tar.gz |
Dum brute force conversion of all types.
However, StringIO really is ByteIO in most cases, and py2.7 should
run but doesn't.
This should be made work first.
Diffstat (limited to 'git/refs')
-rw-r--r-- | git/refs/log.py | 6 | ||||
-rw-r--r-- | git/refs/symbolic.py | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/git/refs/log.py b/git/refs/log.py index e3f3363c..94e07104 100644 --- a/git/refs/log.py +++ b/git/refs/log.py @@ -17,6 +17,10 @@ from git.objects.util import ( Serializable, altz_to_utctz_str, ) +from git.compat import ( + xrange, + string_types +) import time import re @@ -170,7 +174,7 @@ class RefLog(list, Serializable): :param stream: file-like object containing the revlog in its native format or basestring instance pointing to a file to read""" new_entry = RefLogEntry.from_line - if isinstance(stream, basestring): + if isinstance(stream, string_types): stream = file_contents_ro_filepath(stream) # END handle stream type while True: diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index 0cd04e07..624b1a09 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -19,6 +19,7 @@ from gitdb.util import ( hex_to_bin, LockedFD ) +from git.compat import string_types from .log import RefLog @@ -274,7 +275,7 @@ class SymbolicReference(object): elif isinstance(ref, Object): obj = ref write_value = ref.hexsha - elif isinstance(ref, basestring): + elif isinstance(ref, string_types): try: obj = self.repo.rev_parse(ref + "^{}") # optionally deref tags write_value = obj.hexsha |