From: Denis Berezhnoy Date: 2009-09-11T11:53:51+09:00 Subject: Re: Can not catch PTY::ChildExited exception Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Can not catch PTY::ChildExited exception" > on Fri, 11 Sep 2009 09:56:15 +0900, Denis Berezhnoy > writes: > > |But now the problem is that ChildExited exception can occur at any > |moment after spawn and interrupt program in random place. In my test > |above I never get TEST END printed. > | > |How can I handle this in right way? > > Define the "right way" first. > > I admit asynchronous exception is a bad design choice. pty bundled > with 1.9 has changed to use polling via pty.check method. > > matz. Hi, Saying about "right way" I meant that may be there is a standard Ruby mechanism to handle such async exceptions besides begin rescue operators. I am newbie in Ruby so I am not sure about its capabilities. But you answered my question. This is a flaw in design of Ruby PTY component and we can not avoid interrupting code by child exited exception. Anyway thanks for clarification. I will look how I can patch PTY in Ruby to eliminate generating PTY::ChildExited exception at all. Best regards, Denis -- Posted via http://www.ruby-forum.com/.