MCPcopy Index your code
hub / github.com/python/cpython / __repr__

Method __repr__

Lib/multiprocessing/synchronize.py:178–192  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

176 SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
177
178 def __repr__(self):
179 try:
180 if self._semlock._is_mine():
181 name = process.current_process().name
182 if threading.current_thread().name != 'MainThread':
183 name += '|' + threading.current_thread().name
184 elif not self._semlock._is_zero():
185 name = 'None'
186 elif self._semlock._count() > 0:
187 name = 'SomeOtherThread'
188 else:
189 name = 'SomeOtherProcess'
190 except Exception:
191 name = 'unknown'
192 return '<%s(owner=%s)>' % (self.__class__.__name__, name)
193
194#
195# Recursive lock

Callers

nothing calls this directly

Calls 1

_countMethod · 0.80

Tested by

no test coverage detected