Skip to content

Commit

Permalink
Down-cast Project value arg before dict lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
bswck committed Feb 3, 2024
1 parent d08afd4 commit 6bf98de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions jaraco/develop/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,11 @@ class Project(str):
cache = {}

def __new__(cls, value, **kwargs):
# Down-cast to a string early.
value = sys.intern(str(value))
try:
return cls.cache[value]
except KeyError:
# Down-cast to a string early.
value = str(value)
sys.intern(value) # :)
new = super().__new__(cls, value)
cls.cache[new] = new
return new
Expand Down

0 comments on commit 6bf98de

Please sign in to comment.