summaryrefslogtreecommitdiffstats
path: root/DeDRM_plugin/kindlekey.py
diff options
context:
space:
mode:
Diffstat (limited to 'DeDRM_plugin/kindlekey.py')
-rw-r--r--DeDRM_plugin/kindlekey.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/DeDRM_plugin/kindlekey.py b/DeDRM_plugin/kindlekey.py
index 60a6065..14e4ed1 100644
--- a/DeDRM_plugin/kindlekey.py
+++ b/DeDRM_plugin/kindlekey.py
@@ -279,7 +279,10 @@ if iswindows:
path = ""
if 'LOCALAPPDATA' in os.environ.keys():
# Python 2.x does not return unicode env. Use Python 3.x
- path = winreg.ExpandEnvironmentStrings("%LOCALAPPDATA%")
+ if sys.version_info[0] == 2:
+ path = winreg.ExpandEnvironmentStrings(u"%LOCALAPPDATA%")
+ else:
+ path = winreg.ExpandEnvironmentStrings("%LOCALAPPDATA%")
# this is just another alternative.
# path = getEnvironmentVariable('LOCALAPPDATA')
if not os.path.isdir(path):