Skip to content

Commit ccd35ae

Browse files
committed
Ensured that cached contenttypes are keyed by absolute location.
1 parent 5cc934c commit ccd35ae

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/typecode/contenttype.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ def get_type(location):
9292
"""
9393
Return a Type object for location.
9494
"""
95+
abs_loc = os.path.abspath(location)
9596
try:
96-
return _registry[location]
97+
return _registry[abs_loc]
9798
except KeyError:
98-
t = Type(location)
99-
_registry[location] = t
99+
t = Type(abs_loc)
100+
_registry[abs_loc] = t
100101
return t
101102

102103

0 commit comments

Comments
 (0)