On Mon, Jun 27, 2011 at 3:17 PM, Greg Stein <gstein_at_gmail.com> wrote:
> 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.
Old habits die hard. Fixed and thanks for the review.
-Hyrum
Received on 2011-06-27 22:36:43 CEST