[IronPython] Accessing static properties in 2.0b3

TraumaPony pontheangelofdeath at gmail.com
Wed Jul 9 06:19:16 CEST 2008


Sorry, please disregard this. I forgot that it was Task.Current, not
CurrentTask. My bad.

2008/7/9 TraumaPony <pontheangelofdeath at gmail.com>:

> Hi, I'm having trouble accessing static properties in my code. Here's what
> I have:
>
> import clr
>
> clr.AddReference("System.Threading")
>
> def CurrentTask():
>     from System.Threading.Tasks import Task
>     return Task.CurrentTask
>
> def Pause(timeout):
>     CurrentTask().Wait(timeout)
>
> However, when I call CurrentTask(), I get an error:
>
> An unhandled exception of type 'System.MissingMemberException' occurred in
> Unknown Module.
>
> Additional information: 'type' object has no attribute 'CurrentTask'
>
> What am I doing wrong?
>



-- 
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \

This message has been encrypted with ROT-26. Any unauthorised decryption
will result in prosecution to the full extent of the law.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080709/64581fd0/attachment.html>


More information about the Ironpython-users mailing list