Re: [IronPython] ActiveX STA Issue in compiled Winforms EXE

2008-11-08 Thread Davy Mitchell
Thanks Dino - works great now. Runtime speed is much snappier when compiled. One other thing I spotted is that pyc always builds a console app if /main is specified. elif arg.startswith("/main:"): main_name = main = arg[6:] target = System.Reflection.Emit.PEFileKin

Re: [IronPython] Cross-python development: detecting IronPython

2008-11-08 Thread Dan Eloff
I always use sys.platform in ('cli', 'silverlight') because I do a lot of silverlight stuff, but it depends on your scenario. On Sat, Nov 8, 2008 at 3:44 PM, orip <[EMAIL PROTECTED]> wrote: > I'm sorry if this is a repeat (my search abilities failed me), but > what's the standard way to detect whe

Re: [IronPython] ActiveX STA Issue in compiled Winforms EXE

2008-11-08 Thread Dino Viehland
Oh, the problem is that pyc.py doesn't mark the thread as STA. You can add this line to pyc.py right after mainMethod = ... mainMethod.SetCustomAttribute(clr.GetClrType(System.STAThreadAttribute).GetConstructor(()), System.Array[System.Byte](())) and it should work. We should do that by defau

Re: [IronPython] ActiveX STA Issue in compiled Winforms EXE

2008-11-08 Thread Davy Mitchell
Thanks Dino - here's the info: Unhandled Exception: System.Threading.ThreadStateException: ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment. at System.Windows.Forms.WebBrowserBase..ctor(String clsidStri

Re: [IronPython] Cross-python development: detecting IronPython

2008-11-08 Thread orip
Thanks! On Nov 8, 10:47 pm, "Curt Hagenlocher" <[EMAIL PROTECTED]> wrote: > >>> import sys > >>> sys.platform > 'cli' > > On Sat, Nov 8, 2008 at 12:44 PM, orip <[EMAIL PROTECTED]> wrote: > > I'm sorry if this is a repeat (my search abilities failed me), but > > what's the standard way to detect wh

Re: [IronPython] Cross-python development: detecting IronPython

2008-11-08 Thread Curt Hagenlocher
>>> import sys >>> sys.platform 'cli' >>> On Sat, Nov 8, 2008 at 12:44 PM, orip <[EMAIL PROTECTED]> wrote: > I'm sorry if this is a repeat (my search abilities failed me), but > what's the standard way to detect whether the current Python platform > is IronPython? > > I usually prefer to check fo

[IronPython] Cross-python development: detecting IronPython

2008-11-08 Thread orip
I'm sorry if this is a repeat (my search abilities failed me), but what's the standard way to detect whether the current Python platform is IronPython? I usually prefer to check for abilities instead of platforms, but sometimes it's inevitable. Thanks, orip. __

Re: [IronPython] Porting from CPython: Figuring out the calling code's directory

2008-11-08 Thread orip
Great idea Michael, thanks! A small price to pay to make it work with IronPython. I'll probably make it optional (affect only IronPython users). On Nov 7, 1:21 pm, Michael Foord <[EMAIL PROTECTED]> wrote: > Why not change the API to: > >    return testoob.collecting.collect_from_files("test_*.py",

Re: [IronPython] Porting from CPython: Figuring out the calling code's directory

2008-11-08 Thread orip
Thanks Dino! I guess I'll try a workaround. On Nov 7, 1:24 am, Dino Viehland <[EMAIL PROTECTED]> wrote: > The short answer is no – we realize frames is a common request and I do have > a prototype implementation of them.  We’re still working on our 2.1 planning   > but it might be available there

Re: [IronPython] ActiveX STA Issue in compiled Winforms EXE

2008-11-08 Thread Dino Viehland
I'd start w/ -X:ExceptionDetail to get the full stack trace. Presumably there's something higher up the stack then the MatchCaller on the stack. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Davy Mitchell Sent: Saturday, November 08, 2008 6:19 AM To: D

Re: [IronPython] ActiveX STA Issue in compiled Winforms EXE

2008-11-08 Thread Davy Mitchell
Hi Michael >Are you doing this from a separate thread? No. It's a couple of modules deep from the 'main' script. Was going to try a single py file to repro. > I assume it works fine when run uncompiled? Yep, runs great. Cheers, Davy On 11/8/08, Michael <[EMAIL PROTECTED]> wrote: > Are you do

Re: [IronPython] ActiveX STA Issue in compiled Winforms EXE

2008-11-08 Thread Michael
Are you doing this from a separate thread? I assume it works fine when run uncompiled? Michael http://www.ironpythoninaction.com On 8 Nov 2008, at 12:10, "Davy Mitchell" <[EMAIL PROTECTED]> wrote: IPY 2.0 RC1 ActiveX Issue in a pyc compiled Winforms EXE which uses the WebBrowser contro

[IronPython] ActiveX STA Issue in compiled Winforms EXE

2008-11-08 Thread Davy Mitchell
IPY 2.0 RC1 ActiveX Issue in a pyc compiled Winforms EXE which uses the WebBrowser control. Unhandled Exception: System.Threading.ThreadStateException: ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.