Re: [Pyobjc-dev] Upgrade to PyObjC 1.0beta
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-08-08 15:22:49
|
On Friday, 8 August, 2003, at 17:10, Bob Swerdlow wrote: > I finally got around to upgrading my application to use PyObjC 1.0 > beta 1 > from PyObjC 0.9. > > The upgrade was easy, but I ran into one problem: > > appleScript = NSAppleScript.alloc().initWithSource_(strScript) > result = appleScript.executeAndReturnError_(None) > > produced this error for the second line: > > TypeError: Need 0 arguments, got 1 > > This had not happened in PyObjC 0.9. When I changed it to: > > result = appleScript.executeAndReturnError_() > > the code worked and the error went away. > > I'm not sure I understand why this is so, as that function is > documented as: > - (NSAppleEventDescriptor *)executeAndReturnError:(NSDictionary > **)errorInfo That's a bug in version 0.9. The 'executeAndReturnError:' method has an output argument, you don't have to supply those when calling methods. |