mirror of
https://github.com/python/cpython
synced 2024-10-08 16:35:12 +00:00
Rename the routine to start the target running _start(), with a compatibility
routine start() calling it. Some suites declare an event start(), which obscures this method, which causes the class initializer to fail when called with start=1. Based on bug report and fix suggestion by Jacob Kaplan-Moss.
This commit is contained in:
parent
bd8ce79390
commit
c8febecd3c
|
@ -157,15 +157,19 @@ def __init__(self, signature=None, start=0, timeout=0):
|
||||||
else:
|
else:
|
||||||
self.send_timeout = AppleEvents.kAEDefaultTimeout
|
self.send_timeout = AppleEvents.kAEDefaultTimeout
|
||||||
if start:
|
if start:
|
||||||
self.start()
|
self._start()
|
||||||
|
|
||||||
def start(self):
|
def _start(self):
|
||||||
"""Start the application, if it is not running yet"""
|
"""Start the application, if it is not running yet"""
|
||||||
try:
|
try:
|
||||||
self.send('ascr', 'noop')
|
self.send('ascr', 'noop')
|
||||||
except AE.Error:
|
except AE.Error:
|
||||||
_launch(self.target_signature)
|
_launch(self.target_signature)
|
||||||
|
|
||||||
|
def start(self):
|
||||||
|
"""Deprecated, used _start()"""
|
||||||
|
self._start()
|
||||||
|
|
||||||
def newevent(self, code, subcode, parameters = {}, attributes = {}):
|
def newevent(self, code, subcode, parameters = {}, attributes = {}):
|
||||||
"""Create a complete structure for an apple event"""
|
"""Create a complete structure for an apple event"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue