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

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

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 10 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/heap.py ('k') | Lib/multiprocessing/queues.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 the `Process` class which emulates `threading.Thread` 2 # Module providing the `Process` class which emulates `threading.Thread`
3 # 3 #
4 # multiprocessing/process.py 4 # multiprocessing/process.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 24 matching lines...) Expand all
35 __all__ = ['Process', 'current_process', 'active_children'] 35 __all__ = ['Process', 'current_process', 'active_children']
36 36
37 # 37 #
38 # Imports 38 # Imports
39 # 39 #
40 40
41 import os 41 import os
42 import sys 42 import sys
43 import signal 43 import signal
44 import itertools 44 import itertools
45 from _weakrefset import WeakSet
46 45
47 # 46 #
48 # 47 #
49 # 48 #
50 49
51 try: 50 try:
52 ORIGINAL_DIR = os.path.abspath(os.getcwd()) 51 ORIGINAL_DIR = os.path.abspath(os.getcwd())
53 except OSError: 52 except OSError:
54 ORIGINAL_DIR = None 53 ORIGINAL_DIR = None
55 54
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 else: 102 else:
104 self._daemonic = _current_process._daemonic 103 self._daemonic = _current_process._daemonic
105 self._tempdir = _current_process._tempdir 104 self._tempdir = _current_process._tempdir
106 self._parent_pid = os.getpid() 105 self._parent_pid = os.getpid()
107 self._popen = None 106 self._popen = None
108 self._target = target 107 self._target = target
109 self._args = tuple(args) 108 self._args = tuple(args)
110 self._kwargs = dict(kwargs) 109 self._kwargs = dict(kwargs)
111 self._name = name or type(self).__name__ + '-' + \ 110 self._name = name or type(self).__name__ + '-' + \
112 ':'.join(str(i) for i in self._identity) 111 ':'.join(str(i) for i in self._identity)
113 _dangling.add(self)
114 112
115 def run(self): 113 def run(self):
116 ''' 114 '''
117 Method to be run in sub-process; can be overridden in sub-class 115 Method to be run in sub-process; can be overridden in sub-class
118 ''' 116 '''
119 if self._target: 117 if self._target:
120 self._target(*self._args, **self._kwargs) 118 self._target(*self._args, **self._kwargs)
121 119
122 def start(self): 120 def start(self):
123 ''' 121 '''
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 337
340 # 338 #
341 # Give names to some return codes 339 # Give names to some return codes
342 # 340 #
343 341
344 _exitcode_to_name = {} 342 _exitcode_to_name = {}
345 343
346 for name, signum in list(signal.__dict__.items()): 344 for name, signum in list(signal.__dict__.items()):
347 if name[:3]=='SIG' and '_' not in name: 345 if name[:3]=='SIG' and '_' not in name:
348 _exitcode_to_name[-signum] = name 346 _exitcode_to_name[-signum] = name
349
350 # For debug and leak testing
351 _dangling = WeakSet()
OLDNEW
« no previous file with comments | « Lib/multiprocessing/heap.py ('k') | Lib/multiprocessing/queues.py » ('j') | no next file with comments »

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