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

Side by Side Diff: gclient_utils.py

Issue 3110030: Fix for files not ending with \n, otherwise the last line would be ignored. (Closed)
Patch Set: Created 10 years, 4 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
« 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 2009 Google Inc. All Rights Reserved. 1 # Copyright 2009 Google Inc. All Rights Reserved.
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 if filter_fn: 310 if filter_fn:
311 filter_fn(in_line) 311 filter_fn(in_line)
312 in_line = '' 312 in_line = ''
313 # Flush at least 10 seconds between line writes. We wait at least 10 313 # Flush at least 10 seconds between line writes. We wait at least 10
314 # seconds to avoid overloading the reader that called us with output, 314 # seconds to avoid overloading the reader that called us with output,
315 # which can slow busy readers down. 315 # which can slow busy readers down.
316 if (time.time() - last_flushed_at) > 10: 316 if (time.time() - last_flushed_at) > 10:
317 last_flushed_at = time.time() 317 last_flushed_at = time.time()
318 sys.stdout.flush() 318 sys.stdout.flush()
319 in_byte = kid.stdout.read(1) 319 in_byte = kid.stdout.read(1)
320 # Flush the rest of buffered output. This is only an issue with files not
321 # ending with a \n.
322 if len(in_line) and filter_fn:
323 filter_fn(in_line)
320 rv = kid.wait() 324 rv = kid.wait()
321 325
322 if rv: 326 if rv:
323 msg = 'failed to run command: %s' % ' '.join(command) 327 msg = 'failed to run command: %s' % ' '.join(command)
324 328
325 if fail_status != None: 329 if fail_status != None:
326 print >>sys.stderr, msg 330 print >>sys.stderr, msg
327 sys.exit(fail_status) 331 sys.exit(fail_status)
328 332
329 raise Error(msg) 333 raise Error(msg)
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 if exception: 524 if exception:
521 self.parent.exceptions.append(exception) 525 self.parent.exceptions.append(exception)
522 if self.parent.progress: 526 if self.parent.progress:
523 self.parent.progress.update(1) 527 self.parent.progress.update(1)
524 assert not self.item.name in self.parent.ran 528 assert not self.item.name in self.parent.ran
525 if not self.item.name in self.parent.ran: 529 if not self.item.name in self.parent.ran:
526 self.parent.ran.append(self.item.name) 530 self.parent.ran.append(self.item.name)
527 finally: 531 finally:
528 self.parent.ready_cond.notifyAll() 532 self.parent.ready_cond.notifyAll()
529 self.parent.ready_cond.release() 533 self.parent.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