Skip to content

Commit 140104a

Browse files
committed
Upgrade Python syntax with pyupgrade https://github.com/asottile/pyupgrade
1 parent 857196a commit 140104a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

gitdb/db/pack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def update_cache(self, force=False):
148148
# packs are supposed to be prefixed with pack- by git-convention
149149
# get all pack files, figure out what changed
150150
pack_files = set(glob.glob(os.path.join(self.root_path(), "pack-*.pack")))
151-
our_pack_files = set(item[1].pack().path() for item in self._entities)
151+
our_pack_files = {item[1].pack().path() for item in self._entities}
152152

153153
# new packs
154154
for pack_file in (pack_files - our_pack_files):

gitdb/db/ref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _update_dbs_from_ref_file(self):
4949
# END handle alternates
5050

5151
ref_paths_set = set(ref_paths)
52-
cur_ref_paths_set = set(db.root_path() for db in self._dbs)
52+
cur_ref_paths_set = {db.root_path() for db in self._dbs}
5353

5454
# remove existing
5555
for path in (cur_ref_paths_set - ref_paths_set):

gitdb/test/lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def wrapper(self):
8686
try:
8787
return func(self, path)
8888
except Exception:
89-
sys.stderr.write("Test %s.%s failed, output is at %r\n" % (type(self).__name__, func.__name__, path))
89+
sys.stderr.write("Test {}.{} failed, output is at {!r}\n".format(type(self).__name__, func.__name__, path))
9090
keep = True
9191
raise
9292
finally:

0 commit comments

Comments
 (0)