Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Side by Side Diff: Lib/multiprocessing/util.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/multiprocessing/queues.py ('k') | Lib/opcode.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 1 #
2 # Module providing various facilities to other parts of the package 2 # Module providing various facilities to other parts of the package
3 # 3 #
4 # multiprocessing/util.py 4 # multiprocessing/util.py
5 # 5 #
6 # Copyright (c) 2006-2008, R Oudkerk 6 # Copyright (c) 2006-2008, R Oudkerk
7 # All rights reserved. 7 # All rights reserved.
8 # 8 #
9 # Redistribution and use in source and binary forms, with or without 9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions 10 # modification, are permitted provided that the following conditions
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 else: 181 else:
182 assert exitpriority is not None 182 assert exitpriority is not None
183 183
184 self._callback = callback 184 self._callback = callback
185 self._args = args 185 self._args = args
186 self._kwargs = kwargs or {} 186 self._kwargs = kwargs or {}
187 self._key = (exitpriority, next(_finalizer_counter)) 187 self._key = (exitpriority, next(_finalizer_counter))
188 188
189 _finalizer_registry[self._key] = self 189 _finalizer_registry[self._key] = self
190 190
191 def __call__(self, wr=None, 191 def __call__(self, wr=None):
192 # Need to bind these locally because the globals can have
193 # been cleared at shutdown
194 _finalizer_registry=_finalizer_registry,
195 sub_debug=sub_debug):
196 ''' 192 '''
197 Run the callback unless it has already been called or cancelled 193 Run the callback unless it has already been called or cancelled
198 ''' 194 '''
199 try: 195 try:
200 del _finalizer_registry[self._key] 196 del _finalizer_registry[self._key]
201 except KeyError: 197 except KeyError:
202 sub_debug('finalizer no longer registered') 198 sub_debug('finalizer no longer registered')
203 else: 199 else:
204 sub_debug('finalizer calling %s with args %s and kwargs %s', 200 sub_debug('finalizer calling %s with args %s and kwargs %s',
205 self._callback, self._args, self._kwargs) 201 self._callback, self._args, self._kwargs)
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 def wrapped(*args, **kwargs): 328 def wrapped(*args, **kwargs):
333 while True: 329 while True:
334 try: 330 try:
335 return func(*args, **kwargs) 331 return func(*args, **kwargs)
336 except _errors as e: 332 except _errors as e:
337 # select.error has no `errno` attribute 333 # select.error has no `errno` attribute
338 if e.args[0] == errno.EINTR: 334 if e.args[0] == errno.EINTR:
339 continue 335 continue
340 raise 336 raise
341 return wrapped 337 return wrapped
OLDNEW
« no previous file with comments | « Lib/multiprocessing/queues.py ('k') | Lib/opcode.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+