@@ -606,11 +606,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
606
606
if verbose:
607
607
print("keywords are unexpanded, not using")
608
608
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
609
- refs = set( r.strip() for r in refnames.strip("()").split(","))
609
+ refs = { r.strip() for r in refnames.strip("()").split(",")}
610
610
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
611
611
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
612
612
TAG = "tag: "
613
- tags = set( r[len(TAG):] for r in refs if r.startswith(TAG))
613
+ tags = { r[len(TAG):] for r in refs if r.startswith(TAG)}
614
614
if not tags:
615
615
# Either we're using git < 1.8.3, or there really are no tags. We use
616
616
# a heuristic: assume all version tags have a digit. The old git %%d
@@ -619,7 +619,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
619
619
# between branches and tags. By ignoring refnames without digits, we
620
620
# filter out many common branch names like "release" and
621
621
# "stabilization", as well as "HEAD" and "master".
622
- tags = set( r for r in refs if re.search(r'\d', r))
622
+ tags = { r for r in refs if re.search(r'\d', r)}
623
623
if verbose:
624
624
print("discarding '%%s', no digits" %% ",".join(refs-tags))
625
625
if verbose:
@@ -960,11 +960,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
960
960
if verbose :
961
961
print ("keywords are unexpanded, not using" )
962
962
raise NotThisMethod ("unexpanded keywords, not a git-archive tarball" )
963
- refs = set ( r .strip () for r in refnames .strip ("()" ).split ("," ))
963
+ refs = { r .strip () for r in refnames .strip ("()" ).split ("," )}
964
964
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
965
965
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
966
966
TAG = "tag: "
967
- tags = set ( r [len (TAG ):] for r in refs if r .startswith (TAG ))
967
+ tags = { r [len (TAG ):] for r in refs if r .startswith (TAG )}
968
968
if not tags :
969
969
# Either we're using git < 1.8.3, or there really are no tags. We use
970
970
# a heuristic: assume all version tags have a digit. The old git %d
@@ -973,7 +973,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
973
973
# between branches and tags. By ignoring refnames without digits, we
974
974
# filter out many common branch names like "release" and
975
975
# "stabilization", as well as "HEAD" and "master".
976
- tags = set ( r for r in refs if re .search (r'\d' , r ))
976
+ tags = { r for r in refs if re .search (r'\d' , r )}
977
977
if verbose :
978
978
print ("discarding '%s', no digits" % "," .join (refs - tags ))
979
979
if verbose :
0 commit comments