Skip to content

Commit f4c6511

Browse files
2 parents ae4fac1 + b5b4e15 commit f4c6511

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mangopaysdk/configuration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from mangopaysdk.tools import enums
22
import logging
3+
import tempfile
34

45

56
class Configuration:
@@ -15,7 +16,7 @@ class Configuration:
1516
BaseUrl = 'https://api.sandbox.mangopay.com'
1617

1718
# path to temp - required to cache auth tokens
18-
TempPath = "c:\Temp\\"
19+
TempPath = tempfile.tempdir or "c:\Temp"
1920

2021
# Constant to switch debug mode (0/1) - display all request and response data
2122
DebugMode = 0

mangopaysdk/tools/storages/defaultstoragestrategy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def Get(self):
1414
"""Gets the currently stored objects as dictionary.
1515
return stored Token dictionary or null.
1616
"""
17-
DefaultStorageStrategy.cache_path = Configuration.TempPath + "cached-data.py"
17+
DefaultStorageStrategy.cache_path = os.path.join(Configuration.TempPath, "cached-data.py")
1818

1919
if not os.path.exists(DefaultStorageStrategy.cache_path):
2020
return None
@@ -39,7 +39,7 @@ def Store(self, obj):
3939
"""Stores authorization token passed as an argument.
4040
param obj instance to be stored.
4141
"""
42-
DefaultStorageStrategy.cache_path = Configuration.TempPath + "cached-data.py"
42+
DefaultStorageStrategy.cache_path = os.path.join(Configuration.TempPath, "cached-data.py")
4343

4444
if obj == None:
4545
return

0 commit comments

Comments
 (0)