Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: gclient_utils.py

Issue 6683028: Fix win32api and win32con definition order. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generic utils.""" 5 """Generic utils."""
6 6
7 import errno 7 import errno
8 import logging 8 import logging
9 import os 9 import os
10 import Queue 10 import Queue
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 will never lack write permission on *path's parent. 209 will never lack write permission on *path's parent.
210 """ 210 """
211 if not os.path.exists(path): 211 if not os.path.exists(path):
212 return 212 return
213 213
214 if os.path.islink(path) or not os.path.isdir(path): 214 if os.path.islink(path) or not os.path.isdir(path):
215 raise Error('Called rmtree(%s) in non-directory' % path) 215 raise Error('Called rmtree(%s) in non-directory' % path)
216 216
217 if sys.platform == 'win32': 217 if sys.platform == 'win32':
218 # Some people don't have the APIs installed. In that case we'll do without. 218 # Some people don't have the APIs installed. In that case we'll do without.
219 win32api = None
220 win32con = None
219 try: 221 try:
220 win32api = __import__('win32api') 222 # Unable to import 'XX'
221 win32con = __import__('win32con') 223 # pylint: disable=F0401
224 import win32api, win32con
222 except ImportError: 225 except ImportError:
223 pass 226 pass
224 else: 227 else:
225 # On POSIX systems, we need the x-bit set on the directory to access it, 228 # On POSIX systems, we need the x-bit set on the directory to access it,
226 # the r-bit to see its contents, and the w-bit to remove files from it. 229 # the r-bit to see its contents, and the w-bit to remove files from it.
227 # The actual modes of the files within the directory is irrelevant. 230 # The actual modes of the files within the directory is irrelevant.
228 os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) 231 os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
229 232
230 def remove(func, subpath): 233 def remove(func, subpath):
231 if sys.platform == 'win32': 234 if sys.platform == 'win32':
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 logging.info('Caught exception in thread %s' % self.item.name) 703 logging.info('Caught exception in thread %s' % self.item.name)
701 logging.info(str(sys.exc_info())) 704 logging.info(str(sys.exc_info()))
702 work_queue.exceptions.put(sys.exc_info()) 705 work_queue.exceptions.put(sys.exc_info())
703 logging.info('Task %s done' % self.item.name) 706 logging.info('Task %s done' % self.item.name)
704 707
705 work_queue.ready_cond.acquire() 708 work_queue.ready_cond.acquire()
706 try: 709 try:
707 work_queue.ready_cond.notifyAll() 710 work_queue.ready_cond.notifyAll()
708 finally: 711 finally:
709 work_queue.ready_cond.release() 712 work_queue.ready_cond.release()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698