> Mark Hammond escribió:
> > Hi all,
> >   I've finally released pywin32 build 211!
> 
> Is there any attribute in some module I could check to make sure that
> the imported module corresponds to this build? I can't find some sort
> of
> "global" pywin32 module with this information.

Apart from the fact I screwed up the version number with build 211, there is
a pywin32.version.txt file in the site-packages directory (use distutils to
find that path).  Alternatively, use the win32api file version functions to
get the version numbers from any of the .dll/.pyd/.exe files.

FWIW, here is how Pythonwin's Help->About menu does it:

                # Get the build number - written by installers.
                # For distutils build, read pywin32.version.txt
                import distutils.sysconfig
                site_packages =
distutils.sysconfig.get_python_lib(plat_specific=1)
                try:
                        build_no = open(os.path.join(site_packages,
"pywin32.version.txt")).read().strip()
                        ver = "pywin32 build %s" % build_no
                except EnvironmentError:
                        ver = None
                if ver is None:
                        # See if we are Part of Active Python
                        ver =
_GetRegistryValue("SOFTWARE\\ActiveState\\ActivePython", "CurrentVersion")
                        if ver is not None:
                                ver = "ActivePython build %s" % (ver,)
                if ver is None:
                        ver = ""

HTH,

Mark


_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to