From dd5fd2a2c3fc3176896c3a121fb92ac7b949ebd8 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Wed, 14 Sep 2022 18:02:59 -0400 Subject: [PATCH] Update __init__.py --- src/gam/gapi/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gam/gapi/__init__.py b/src/gam/gapi/__init__.py index 160d5a5d..b5f25303 100644 --- a/src/gam/gapi/__init__.py +++ b/src/gam/gapi/__init__.py @@ -339,9 +339,10 @@ def get_all_pages(service, else: kwargs.update(page_key) if GC_Values[GC_LOW_MEMORY]: - tempdir = TemporaryDirectory( - prefix='GAM-', - ignore_cleanup_errors=True) + kwargs = {'prefix': 'GAM-'} + if sys.version_info.minor >= 10: + kwargs['ignore_cleanup_errors'] = True + tempdir = TemporaryDirectory(**kwargs) tempfile = os.path.join(tempdir.name, 'gapi_pages') all_items = shelve.open(tempfile) # attach tempdir to all_items so we