mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version
Date: Sat, 19 Apr 2014 18:29:00 +0200	[thread overview]
Message-ID: <20140419162858.GA17216@omega> (raw)
In-Reply-To: <20140419141521.GA18640@pengutronix.de>

Hi,

On Sat, Apr 19, 2014 at 04:15:21PM +0200, Michael Olbrich wrote:
> On Thu, Apr 17, 2014 at 09:38:36AM +0200, Alexander Aring wrote:
> > Hi,
> > 
> > On Tue, Apr 15, 2014 at 11:36:53AM +0200, Alexander Aring wrote:
> > > Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> > > ---
> > >  configure.ac | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > > 
> > > diff --git a/configure.ac b/configure.ac
> > > index 2a97944..ce4e539 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -304,6 +304,18 @@ AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executabl
> > >  	AC_PATH_PROGS(PYTHON, python2.7 python2.6 python)
> > >  	AC_SUBST(PYTHON)
> > >      ])
> > > +
> > > +dnl
> > > +dnl Check for Python 2.x
> > > +dnl
> > > +AC_MSG_CHECKING([check for Python major version])
> > > +PYTHON_MAJOR_VERSION=`$PYTHON -c "import sys; print(sys.version_info[[0]])" 2> /dev/null`
> > 
> > I think a $PYTHON -c "import sys; print(sys.version_info.major) is
> 
> $ python2.6 -c "import sys; print(sys.version_info.major)"
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> AttributeError: 'tuple' object has no attribute 'major'
> 
grml :(

> > better here instead of the array access. I wait for Michaels opinion for
> > the rest of the patches in this series. If all seems fine I will resend a v4.
> 
> Maybe parsing "$PYTHON --version" is a better idea?
> 
Yea, I will falling back on the sed solution, which was my first
solution to check on the python version. Need to redirect stderr to
stdout for this because the version is printed out on stderr.

Thanks for you opinion and test with python 2.6.

- Alex

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2014-04-19 16:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15  9:36 [ptxdist] [PATCH v3 0/4] ptxdist: check python configure.ac and libusb Alexander Aring
2014-04-15  9:36 ` [ptxdist] [PATCH v3 1/4] libusb: rename libusbx to libusb Alexander Aring
2014-04-15  9:36 ` [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version Alexander Aring
2014-04-17  7:38   ` Alexander Aring
2014-04-19 14:15     ` Michael Olbrich
2014-04-19 16:29       ` Alexander Aring [this message]
2014-04-15  9:36 ` [ptxdist] [PATCH v3 3/4] configure.ac: check for python2 binary as well Alexander Aring
2014-04-15  9:36 ` [ptxdist] [PATCH v3 4/4] configure.ac: use Python instead python everywhere Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140419162858.GA17216@omega \
    --to=alex.aring@gmail.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox