We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 597f024 commit 5c52b9fCopy full SHA for 5c52b9f
1 file changed
pokepy/api.py
@@ -9,6 +9,7 @@
9
10
import functools
11
import os
12
+import sys
13
import types
14
from collections import namedtuple
15
import appdirs # dependency of FileCache
@@ -54,6 +55,10 @@ def caching(disk_or_memory, cache_directory=None):
54
55
def memoize(func):
56
if disk_or_memory == 'disk':
57
if cache_directory:
58
+ # Python 2 workaround
59
+ if sys.version_info[0] == 2 and not isinstance(cache_directory, str):
60
+ raise TypeError('expected str')
61
+
62
cache_dir = os.path.join(cache_directory, 'pokepy_cache', str(get_methods_id[0]))
63
else:
64
cache_dir = os.path.join(
0 commit comments