[py-dev] Re: [py-svn] r10550 - py/dist/py/path/local

Brian Dorsey briandorsey at gmail.com
Tue Apr 12 17:57:08 CEST 2005


Armin, 

This change breaks py.test on windows for me, since os.path.samefile
doesn't seem to exist in windows.

Take care,
-Brian

On Apr 12, 2005 7:24 AM, arigo at codespeak.net <arigo at codespeak.net> wrote:
> Author: arigo
> Date: Tue Apr 12 16:24:09 2005
> New Revision: 10550
> 
> Modified:
>    py/dist/py/path/local/local.py
> Log:
> Oups.  Crashed if the co_filename stored in .pyc files doesn't exist at all.
> 
> Modified: py/dist/py/path/local/local.py
> ==============================================================================
> --- py/dist/py/path/local/local.py      (original)
> +++ py/dist/py/path/local/local.py      Tue Apr 12 16:24:09 2005
> @@ -347,8 +347,13 @@
>                              co = py.std.marshal.load(f)
>                              path1 = co.co_filename
>                              path2 = str(self)
> -                            if path1 == path2 or os.path.samefile(path1, path2):
> +                            if path1 == path2:
>                                  return co
> +                            try:
> +                                if os.path.samefile(path1, path2):
> +                                    return co
> +                            except OSError:   # probably path1 not found
> +                                pass
>                  finally:
>                      f.close()
>              except py.error.Error:
> _______________________________________________
> py-svn mailing list
> py-svn at codespeak.net
> http://codespeak.net/mailman/listinfo/py-svn
>



More information about the Pytest-dev mailing list