public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Pete Wyckoff <pw@padd•com>
To: Brandon Casey <drafnel@gmail•com>
Cc: git@vger•kernel.org, esr@thyrsus•com, john@keeping•me.uk,
	Brandon Casey <bcasey@nvidia•com>
Subject: Re: [PATCH 2/2] git-p4.py: support Python 2.4
Date: Sat, 26 Jan 2013 07:48:54 -0500	[thread overview]
Message-ID: <20130126124854.GB31052@padd.com> (raw)
In-Reply-To: <1359146641-27810-3-git-send-email-drafnel@gmail.com>

drafnel@gmail•com wrote on Fri, 25 Jan 2013 12:44 -0800:
> Python 2.4 lacks the following features:
> 
>    subprocess.check_call
>    struct.pack_into
> 
> Take a cue from 460d1026 and provide an implementation of the
> CalledProcessError exception.  Then replace the calls to
> subproccess.check_call with calls to subprocess.call that check the return
> status and raise a CalledProcessError exception if necessary.
> 
> The struct.pack_into in t/9802 can be converted into a single struct.pack
> call which is available in Python 2.4.

Excellent.  Should have used struct.pack() from the get-go.

Acked-by: Pete Wyckoff <pw@padd•com>

> diff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh
> index 21924df..be299dc 100755
> --- a/t/t9802-git-p4-filetype.sh
> +++ b/t/t9802-git-p4-filetype.sh
> @@ -105,12 +105,13 @@ build_gendouble() {
>  	cat >gendouble.py <<-\EOF
>  	import sys
>  	import struct
> -	import array
>  
> -	s = array.array("c", '\0' * 26)
> -	struct.pack_into(">L", s,  0, 0x00051607)  # AppleDouble
> -	struct.pack_into(">L", s,  4, 0x00020000)  # version 2
> -	s.tofile(sys.stdout)
> +	s = struct.pack(">LL18s",
> +			0x00051607,  # AppleDouble
> +			0x00020000,  # version 2
> +			""           # pad to 26 bytes
> +	)
> +	sys.stdout.write(s);
>  	EOF

One stray semicolon.

In terms of maintenance, I'll not run tests with 2.4 or 2.5
myself, but maybe you would be willing to check an RC candidate
each release?

		-- Pete

  reply	other threads:[~2013-01-26 12:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25 20:43 [PATCH 0/2] git-p4 support for older python Brandon Casey
2013-01-25 20:44 ` [PATCH 1/2] git-p4.py: support Python 2.5 Brandon Casey
2013-01-26 12:45   ` Pete Wyckoff
2013-01-26 18:19     ` Brandon Casey
2013-01-25 20:44 ` [PATCH 2/2] git-p4.py: support Python 2.4 Brandon Casey
2013-01-26 12:48   ` Pete Wyckoff [this message]
2013-01-26 19:02     ` Brandon Casey
2013-01-25 21:10 ` [PATCH 0/2] git-p4 support for older python Junio C Hamano

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=20130126124854.GB31052@padd.com \
    --to=pw@padd$(echo .)com \
    --cc=bcasey@nvidia$(echo .)com \
    --cc=drafnel@gmail$(echo .)com \
    --cc=esr@thyrsus$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=john@keeping$(echo .)me.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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