summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSridhar Ratnakumar <github@srid.name>2014-08-17 11:39:15 -0700
committerSridhar Ratnakumar <github@srid.name>2014-08-17 11:39:15 -0700
commit9c93e5e0e96cef5837b4fc906f35b8c0bda87924 (patch)
tree568c9975fc5055a700b7271f807b509fc7909ef7
parentb1c99d3b2cf33369cd8eca495f9be39528ab7071 (diff)
downloadappdirs-9c93e5e0e96cef5837b4fc906f35b8c0bda87924.tar.gz
import winreg on py3
fixes #38
-rw-r--r--CHANGES.rst2
-rw-r--r--appdirs.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index d9695b7..dfd1262 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,7 +4,7 @@ appdirs Changelog
appdirs 1.4.1 (dev)
-------------------
-- ...
+- [issue #38] Fix _winreg import on Windows Py3
appdirs 1.4.0
-------------
diff --git a/appdirs.py b/appdirs.py
index f74e27a..0342a07 100644
--- a/appdirs.py
+++ b/appdirs.py
@@ -410,7 +410,10 @@ def _get_win_folder_from_registry(csidl_name):
registry for this guarantees us the correct answer for all CSIDL_*
names.
"""
- import _winreg
+ if PY3:
+ import winreg as _winreg
+ else:
+ import _winreg
shell_folder_name = {
"CSIDL_APPDATA": "AppData",