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

Brian Dorsey briandorsey at gmail.com
Tue Apr 12 18:34:45 MEST 2005


And, actually I didn't read this correctly, it looks like samefile was
already there, I just hadn't run into the error until now. I'm not
sure exactly how this code is used... would it be safe to skip this
check on windows, or should I dig around to find some sort of
equivalent version for windows?

Take care,
-Brian

On Apr 12, 2005 8:57 AM, Brian Dorsey <briandorsey at gmail.com> wrote:
> 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 py-dev mailing list