[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1140248 - /subversion/trunk/tools/dist/release.py

From: Greg Stein <gstein_at_gmail.com>
Date: Mon, 27 Jun 2011 16:17:54 -0400

On Mon, Jun 27, 2011 at 13:44, <hwright_at_apache.org> wrote:
>...
> +++ subversion/trunk/tools/dist/release.py Mon Jun 27 17:44:05 2011
> @@ -108,6 +108,13 @@ def download_file(url, target):
>     target_file = open(target, 'w')
>     target_file.write(response.read())
>
> +def split_version(version):
> +    parts = version.split('-')
> +    if len(parts) == 1:
> +        return (version, None)
> +
> +    return (parts[0], parts[1])

The parens on the return statements are redundant. Python already
creates a tuple from each of the returned values.

>...
> @@ -259,8 +266,7 @@ def build_env(base_dir, args):
>  def roll_tarballs(base_dir, args):
>     'Create the release artifacts.'
>     extns = ['zip', 'tar.gz', 'tar.bz2']
> -    version_base = args.version.split('-')[0]
> -    version_extra = args.version.split('-')[1]
> +    (version_base, version_extra) = split_version(args.version)

The parens are not required for tuple-unpacking.

Same issue in the other two call-sites.

>...

Cheers,
-g
Received on 2011-06-27 22:18:27 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.