Skip to content

Commit

Permalink
don't ValueError fail wintypes import on non-Windows
Browse files Browse the repository at this point in the history
...as per suggestion on Python.org bug tracker
http://bugs.python.org/issue16396

Another run at #48
  • Loading branch information
maphew committed Jun 21, 2015
1 parent 08033fb commit 2920784
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions knownpaths.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
'''Python wrapper around the SHGetKnownFolderPath Windows Shell function
knownpaths.py, from https://gist.github.com/mkropat/7550097
'''
import ctypes, sys
from ctypes import windll, wintypes
from uuid import UUID
import sys
import ctypes
try:

from ctypes import windll, wintypes
except ImportError, ValueError:
# catch ImportError and ValueError due to issue16396
# http://bugs.python.org/issue16396
pass

from uuid import UUID
class GUID(ctypes.Structure): # [1]
_fields_ = [
("Data1", wintypes.DWORD),
Expand Down

0 comments on commit 2920784

Please sign in to comment.