Fix case where wc_info is not present.
Reapply r80770 "Switch from xml.dom.minidom to xml.etree".
TBR=dpranke@chromium.org
BUG=
TEST=
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80785 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/fix_encoding.py b/fix_encoding.py
index 87e54a5..61bd742 100644
--- a/fix_encoding.py
+++ b/fix_encoding.py
@@ -81,6 +81,8 @@
if _SYS_ARGV_PROCESSED:
return False
+ # These types are available on linux but not Mac.
+ # pylint: disable=E0611,F0401
from ctypes import byref, c_int, POINTER, windll, WINFUNCTYPE
from ctypes.wintypes import LPCWSTR, LPWSTR
@@ -186,6 +188,8 @@
self._console_handle = console_handle
# Loads the necessary function.
+ # These types are available on linux but not Mac.
+ # pylint: disable=E0611,F0401
from ctypes import byref, GetLastError, POINTER, windll, WINFUNCTYPE
from ctypes.wintypes import BOOL, DWORD, HANDLE, LPWSTR
from ctypes.wintypes import LPVOID # pylint: disable=E0611
@@ -266,6 +270,8 @@
def win_handle_is_a_console(handle):
"""Returns True if a Windows file handle is a handle to a console."""
+ # These types are available on linux but not Mac.
+ # pylint: disable=E0611,F0401
from ctypes import byref, POINTER, windll, WINFUNCTYPE
from ctypes.wintypes import BOOL, DWORD, HANDLE
@@ -297,6 +303,8 @@
"""
old_fileno = getattr(stream, 'fileno', lambda: None)()
if old_fileno == excepted_fileno:
+ # These types are available on linux but not Mac.
+ # pylint: disable=E0611,F0401
from ctypes import windll, WINFUNCTYPE
from ctypes.wintypes import DWORD, HANDLE