diff options
author | Harmon <Harmon758@gmail.com> | 2020-02-07 06:20:23 -0600 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-02-08 10:55:50 +0800 |
commit | 768b9fffa58e82d6aa1f799bd5caebede9c9231b (patch) | |
tree | 0f995bb2702601f5edc3db05c85169f12e547ee8 /git/refs | |
parent | 5d22d57010e064cfb9e0b6160e7bd3bb31dbfffc (diff) | |
download | gitpython-768b9fffa58e82d6aa1f799bd5caebede9c9231b.tar.gz |
Remove and replace compat.string_types
Diffstat (limited to 'git/refs')
-rw-r--r-- | git/refs/log.py | 7 | ||||
-rw-r--r-- | git/refs/symbolic.py | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/git/refs/log.py b/git/refs/log.py index d51c3458..965b26c7 100644 --- a/git/refs/log.py +++ b/git/refs/log.py @@ -1,10 +1,7 @@ import re import time -from git.compat import ( - string_types, - defenc -) +from git.compat import defenc from git.objects.util import ( parse_date, Serializable, @@ -185,7 +182,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, string_types): + if isinstance(stream, str): 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 766037c1..4784197c 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -1,9 +1,6 @@ import os -from git.compat import ( - string_types, - defenc -) +from git.compat import defenc from git.objects import Object, Commit from git.util import ( join_path, @@ -300,7 +297,7 @@ class SymbolicReference(object): elif isinstance(ref, Object): obj = ref write_value = ref.hexsha - elif isinstance(ref, string_types): + elif isinstance(ref, str): try: obj = self.repo.rev_parse(ref + "^{}") # optionally deref tags write_value = obj.hexsha |