summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Macken <lmacken@redhat.com>2011-01-21 11:19:40 -0500
committerLuke Macken <lmacken@redhat.com>2011-01-21 11:19:40 -0500
commitc8264176e65b41344cd18199e3039f3164dd04c9 (patch)
tree0d331be0ff7e315aa521e98c050f5c2dee3b613a
parentb561ca9230155667372fe9e497e6e8ec2c35b9ea (diff)
Catch pywintypes.com_error Exceptions in our is_admin method.
-rwxr-xr-xliveusb/creator.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 257ccd1..604d696 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -1141,5 +1141,10 @@ class WindowsLiveUSBCreator(LiveUSBCreator):
self.popen('format /Q /X /y /V:Fedora /FS:FAT32 %s' % self.drive['device'])
def is_admin(self):
- from win32com.shell import shell
- return shell.IsUserAnAdmin()
+ import pywintypes
+ try:
+ from win32com.shell import shell
+ return shell.IsUserAnAdmin()
+ except pywintypes.com_error:
+ # Thrown on certain XP installs
+ return True