~ubuntu-branches/ubuntu/wily/pyzmq/wily

« back to all changes in this revision

Viewing changes to perf/patch_for_2.5.py

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2013-02-24 19:23:15 UTC
  • mfrom: (1.2.1) (9 sid)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: package-import@ubuntu.com-20130224192315-qhmwp3m3ymk8r60d
Tags: 2.2.0.1-1
* New upstream release
* relicense debian packaging to LGPL-3
* update watch file to use github directly
  thanks to Bart Martens for the file
* add autopkgtests
* drop obsolete DM-Upload-Allowed
* bump standard to 3.9.4, no changes required

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""patch the perf tests for Python 2.5.
 
2
 
 
3
This just replaces the handful of b'msg' instances with 'msg'.
 
4
"""
 
5
#-----------------------------------------------------------------------------
 
6
#  Copyright (c) 2011-2012 Brian Granger, Min Ragan-Kelley
 
7
#
 
8
#  This file is part of pyzmq
 
9
#
 
10
#  Distributed under the terms of the New BSD License.  The full license is in
 
11
#  the file COPYING.BSD, distributed as part of this software.
 
12
#-----------------------------------------------------------------------------
 
13
 
 
14
for prefix in ('local', 'remote'):
 
15
    for test in ('lat', 'thr'):
 
16
        fname = '%s_%s.py'%(prefix, test)
 
17
        print "patching %s for Python2.5"%fname
 
18
        with open(fname) as f:
 
19
            text = f.read()
 
20
        fixed = text.replace("b'", "'").replace('b"', '"')
 
21
        if fixed == text:
 
22
            print "no change"
 
23
        else:
 
24
            with open('%s_%s.py'%(prefix, test), 'w') as f:
 
25
                f.write(fixed)
 
 
b'\\ No newline at end of file'