Martin Maly wrote:
> There is a way to tell the difference, but first let me provide a little 
> background ...
>
> IronPython is released as signed binaries, and in order to maintain binary 
> compatibility (for example for the customer who writes an application that 
> relies on particular version of IronPython binaries, but then wants to simply 
> replace IronPython 1.0 binaries with 1.0.1 binaries without having to 
> recompile his application) the assembly version is identical with the 
> assembly version of the 1.0 release. However, we added some more 
> assembly-level attributes which can be used to tell the difference between 
> versions. They are AssemblyInformationVersionAttribute and 
> AssemblyFileVersionAttribute. Note that they are not present on the 1.0 
> assemblies.
>
> Unfortunately, due to a omission/bug, one of them 
> (AssemblyInformationVersionAttribute) still reads "1.0" on the 1.0.1 
> assemblies, but the other (AssemblyFileVersionAttribute) changes with each 
> build of IronPython and its version for 1.0.1 release is:
>
> 1.0.61005.1977
>
> Now, how can I find out which version I am running?
>
> import System
> a = 
> [].GetType().Assembly.GetCustomAttributes(System.Reflection.AssemblyFileVersionAttribute,
>  False)
> if len(a) > 0:
>     if a[0].Version == "1.0.61005.1977": print "IronPython 1.0.1"
>     else: print "Unknown version"
> else:
>     print "IronPython 1.0"
>
> Hope this helps and sorry for the confusion with 
> AssemblyInformationVersionAttribute. It'll be fixed in the next release.
>   
What about sys.version? Surely this doesn't have to depend on the
assembly version, in which case it could return values as suggested
earlier in the thread...

David
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to