This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: speeding up dg-extract-results.sh


On Sat, May 24, 2014 at 10:14:54AM -0700, Mike Stump wrote:
> On May 24, 2014, at 4:17 AM, Bernd Schmidt <bernds_cb1@t-online.de> wrote:
> > On 02/13/2014 10:18 AM, Richard Sandiford wrote:
> >> contrib/
> >> 	* dg-extract-results.py: New file.
> >> 	* dg-extract-results.sh: Use it if the environment seems suitable.
> > 
> > I'm now seeing the following:
> > 
> > Traceback (most recent call last):
> >  File "../../git/gcc/../contrib/dg-extract-results.py", line 581, in <module>
> >    Prog().main()
> >  File "../../git/gcc/../contrib/dg-extract-results.py", line 569, in main
> >    self.output_tool (self.runs[name])
> >  File "../../git/gcc/../contrib/dg-extract-results.py", line 534, in output_tool
> >    self.output_variation (tool, variation)
> >  File "../../git/gcc/../contrib/dg-extract-results.py", line 483, in output_variation
> >    for harness in sorted (variation.harnesses.values()):
> > TypeError: unorderable types: HarnessRun() < HarnessRun()
> > 
> > $ /usr/bin/python --version
> > Python 3.3.3
> 
> Seems unfortunateâ  Iâd put in a, if on 3.3 or later, donât use line until a python person can address it.

it looks like __cmp__ which the named class implements doesn't work in
python3, and instead you get to implement __eq__, __ne__, __gt__,
__ge__, __lt__, and __le__ or whatever subset of those is enough to make
sorted happy.

Trev

> 
> Can you try something like the below and see if it works better for youâ  If it does, Iâd approve it, if you would like to put it in.
> 
> Index: dg-extract-results.sh
> ===================================================================
> --- dg-extract-results.sh	(revision 210894)
> +++ dg-extract-results.sh	(working copy)
> @@ -32,7 +32,7 @@ PROGNAME=dg-extract-results.sh
>  PYTHON_VER=`echo "$0" | sed 's/sh$/py/'`
>  if test "$PYTHON_VER" != "$0" &&
>     test -f "$PYTHON_VER" &&
> -   python -c 'import sys; sys.exit (0 if sys.version_info >= (2, 6) else 1)' \
> +   python -c 'import sys; sys.exit (0 if sys.version_info >= (2, 6) and sys.version_info < (3, 3) else 1)' \
>       > /dev/null 2> /dev/null; then
>    exec python $PYTHON_VER "$@"
>  fi

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]