Code refactoring (moving import ctypes to be used only when needed)

This commit is contained in:
Miroslav Stampar
2013-06-04 22:23:44 +02:00
parent 3e0f747fad
commit c1592e8508
3 changed files with 10 additions and 6 deletions

View File

@@ -9,7 +9,6 @@ import codecs
import contextlib
import cookielib
import copy
import ctypes
import httplib
import inspect
import logging
@@ -2209,6 +2208,8 @@ def runningAsAdmin():
isAdmin = isinstance(_, (int, float, long)) and _ == 0
elif IS_WIN:
import ctypes
_ = ctypes.windll.shell32.IsUserAnAdmin()
isAdmin = isinstance(_, (int, float, long)) and _ == 1