Merge lp:~andrea-crotti-0/mailman/version into lp:mailman

Proposed by Andrea Crotti
Status: Rejected
Rejected by: Barry Warsaw
Proposed branch: lp:~andrea-crotti-0/mailman/version
Merge into: lp:mailman
Diff against target: 33 lines (+5/-12)
1 file modified
setup.py (+5/-12)
To merge this branch: bzr merge lp:~andrea-crotti-0/mailman/version
Reviewer Review Type Date Requested Status
Barry Warsaw Disapprove
Review via email: mp+97258@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Sorry, I'm going to reject this branch since I've set the bug to Won't Fix. Thanks for your contribution though!

review: Disapprove

Unmerged revisions

7111. By Andrea Crotti

avoid using regular expressions to look inside the version.py file,
and simply use execfile, which should be allowed to blow up if
something goes wrong in that stage

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'setup.py'
--- setup.py 2012-01-01 19:14:46 +0000
+++ setup.py 2012-03-13 17:20:46 +0000
@@ -18,27 +18,20 @@
18from distribute_setup import use_setuptools18from distribute_setup import use_setuptools
19use_setuptools()19use_setuptools()
2020
21import re
22import sys21import sys
2322
24from setuptools import setup, find_packages23from setuptools import setup, find_packages
25from string import Template24from string import Template
2625
27if sys.hexversion < 0x20600f0:26if sys.version < '2.6':
28 print 'Mailman requires at least Python 2.6'27 print 'Mailman requires at least Python 2.6'
29 sys.exit(1)28 sys.exit(1)
3029
3130
32# Calculate the version number without importing the mailman package.31# if the file it's not there or it doesn't contain the VERSION we
33with open('src/mailman/version.py') as fp:32# can safely blow up
34 for line in fp:33execfile('src/mailman/version.py')
35 mo = re.match("VERSION = '(?P<version>[^']+?)'", line)34__version__ = VERSION
36 if mo:
37 __version__ = mo.group('version')
38 break
39 else:
40 print 'No version number found'
41 sys.exit(1)
4235
4336
4437