From 6bf98dea27f37eaebb06ff0426880ca6202b9848 Mon Sep 17 00:00:00 2001 From: bswck Date: Sat, 3 Feb 2024 23:44:08 +0100 Subject: [PATCH] Down-cast `Project` value arg before dict lookup --- jaraco/develop/git.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jaraco/develop/git.py b/jaraco/develop/git.py index 873377f..649bf63 100644 --- a/jaraco/develop/git.py +++ b/jaraco/develop/git.py @@ -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