[PATCH] run os.expanduser on the kojiconfig attribute in case the path is in the user's home directory
Brian Stinson
bstinson at ksu.edu
Fri Oct 10 14:27:03 UTC 2014
On Oct 10 09:16, Mathieu Bridon wrote:
> On Thu, 2014-10-09 at 21:59 +0000, Brian Stinson wrote:
> > ---
> > src/pyrpkg/__init__.py | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/pyrpkg/__init__.py b/src/pyrpkg/__init__.py
> > index 6961d5e..8403763 100644
> > --- a/src/pyrpkg/__init__.py
> > +++ b/src/pyrpkg/__init__.py
> > @@ -199,7 +199,7 @@ class Commands(object):
> > 'topurl': None
> > }
> > # Process the configs in order, global, user, then any option passed
> > - for configfile in (self.kojiconfig,
> > + for configfile in (os.path.expanduser(self.kojiconfig),
>
> If you expand it when it is used, you'll eventually need to expand it in
> other places, as it might get used elsewhere.
>
> Why not instead expanding it where it gets defined?
>
> - self.kojiconfig = kojiconfig
> + self.kojiconfig = os.path.expanduser(kojiconfig)
>
> This way, all subsequent usage of it is already correct. :)
>
>
> --
> Mathieu
>
> --
> buildsys mailing list
> buildsys at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/buildsys
That definitely makes more sense than what I have :)
Brian
--
Brian Stinson
bstinson at ksu.edu | IRC: bstinson | Bitbucket/Twitter: bstinsonmhk
More information about the buildsys
mailing list