@ -1,16 +1,6 @@
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Generic utils. """
@ -28,6 +18,14 @@ import xml.dom.minidom
import xml . parsers . expat
def hack_subprocess ( ) :
""" subprocess functions may throw exceptions when used in multiple threads.
See http : / / bugs . python . org / issue1731717 for more information .
"""
subprocess . _cleanup = lambda : None
class Error ( Exception ) :
""" gclient exception class. """
pass
@ -573,6 +571,7 @@ class ExecutionQueue(object):
def __init__ ( self , jobs , progress ) :
""" jobs specifies the number of concurrent tasks to allow. progress is a
Progress instance . """
hack_subprocess ( )
# Set when a thread is done or a new item is enqueued.
self . ready_cond = threading . Condition ( )
# Maximum number of concurrent tasks.