Skip to content
Snippets Groups Projects
Commit 86bf652555ee authored by Paul Ganssle's avatar Paul Ganssle
Browse files

Revert "Convert the factories to use a WeakValueDictionary"

This reverts commit 873c5971ebfdf3a10a81d192a6b095064bd7c01b.
parent 7c16a4a3ce30
No related branches found
No related tags found
No related merge requests found
from datetime import timedelta
import weakref
class _TzSingleton(type):
def __init__(cls, *args, **kwargs):
......@@ -19,7 +19,7 @@
class _TzOffsetFactory(_TzFactory):
def __init__(cls, *args, **kwargs):
cls.__instances = weakref.WeakValueDictionary()
cls.__instances = {}
def __call__(cls, name, offset):
if isinstance(offset, timedelta):
......@@ -36,7 +36,7 @@
class _TzStrFactory(_TzFactory):
def __init__(cls, *args, **kwargs):
cls.__instances = weakref.WeakValueDictionary()
cls.__instances = {}
def __call__(cls, s, posix_offset=False):
key = (s, posix_offset)
......
......@@ -13,7 +13,6 @@
import sys
import os
import bisect
import weakref
import six
from six import string_types
......@@ -1529,7 +1528,7 @@
"""
def __init__(self):
self.__instances = weakref.WeakValueDictionary()
self.__instances = {}
self._cache_lock = _thread.allocate_lock()
def __call__(self, name=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment