Skip to content

Commit

Permalink
Only call uuid._load_system_functions() if it exists.
Browse files Browse the repository at this point in the history
This private API has been a no-op for several releases and is going away in Python 3.13.
  • Loading branch information
gpshead authored Mar 2, 2024
1 parent 10924ba commit d75458f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion freezegun/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
uuid_generate_time_attr = '_uuid_generate_time'
except AttributeError:
# noinspection PyUnresolvedReferences
uuid._load_system_functions()
if hasattr(uuid, '_load_system_functions'):
# A no-op after Python ~3.9, being removed in 3.13.
uuid._load_system_functions()
# noinspection PyUnresolvedReferences
real_uuid_generate_time = uuid._generate_time_safe
uuid_generate_time_attr = '_generate_time_safe'
Expand Down

0 comments on commit d75458f

Please sign in to comment.