Merge ~cjwatson/launchpad:avoid-sys-executable into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 7bba68d82ccd5b4d7f4e10226814b5b819b0d6c0
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:avoid-sys-executable
Merge into: launchpad:master
Diff against target: 541 lines (+40/-69)
19 files modified
lib/lp/archivepublisher/tests/test_processdeathrow.py (+1/-2)
lib/lp/archivepublisher/tests/test_publishdistro.py (+1/-2)
lib/lp/archiveuploader/tests/test_processupload.py (+1/-2)
lib/lp/bugs/doc/cve-update.txt (+1/-2)
lib/lp/services/librarianserver/tests/test_gc.py (+2/-3)
lib/lp/services/scripts/doc/launchpad-scripts.txt (+2/-2)
lib/lp/services/statistics/tests/test_update_stats.py (+3/-4)
lib/lp/soyuz/doc/buildd-mass-retry.txt (+4/-8)
lib/lp/soyuz/doc/closing-bugs-from-changelogs.txt (+1/-2)
lib/lp/soyuz/doc/gina-multiple-arch.txt (+2/-3)
lib/lp/soyuz/doc/gina.txt (+7/-11)
lib/lp/soyuz/doc/package-cache-script.txt (+1/-2)
lib/lp/soyuz/doc/soyuz-upload.txt (+6/-9)
lib/lp/soyuz/scripts/tests/test_add_missing_builds.py (+1/-2)
lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py (+1/-2)
lib/lp/soyuz/scripts/tests/test_populatearchive.py (+1/-2)
lib/lp/translations/doc/poexport-request.txt (+1/-5)
lib/lp/translations/doc/rosetta-poimport-script.txt (+1/-2)
lib/lp/translations/doc/sourcepackagerelease-translations.txt (+3/-4)
Reviewer Review Type Date Requested Status
Ioana Lasc Approve
Review via email: mp+408088@code.launchpad.net

Commit message

Remove unnecessary uses of sys.executable

Description of the change

In these cases we're running scripts that already have a perfectly good `#!` line, so there's no need to explicitly invoke them using `sys.executable`.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/archivepublisher/tests/test_processdeathrow.py b/lib/lp/archivepublisher/tests/test_processdeathrow.py
2index a59381a..3c48f98 100644
3--- a/lib/lp/archivepublisher/tests/test_processdeathrow.py
4+++ b/lib/lp/archivepublisher/tests/test_processdeathrow.py
5@@ -14,7 +14,6 @@ import datetime
6 import os
7 import shutil
8 import subprocess
9-import sys
10 from tempfile import mkdtemp
11
12 import pytz
13@@ -40,7 +39,7 @@ class TestProcessDeathRow(TestCaseWithFactory):
14 def runDeathRow(self, extra_args, distribution="ubuntutest"):
15 """Run process-death-row.py, returning the result and output."""
16 script = os.path.join(config.root, "scripts", "process-death-row.py")
17- args = [sys.executable, script, "-v", "-p", self.primary_test_folder]
18+ args = [script, "-v", "-p", self.primary_test_folder]
19 args.extend(extra_args)
20 process = subprocess.Popen(
21 args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
22diff --git a/lib/lp/archivepublisher/tests/test_publishdistro.py b/lib/lp/archivepublisher/tests/test_publishdistro.py
23index 41d81f4..c0f88d0 100644
24--- a/lib/lp/archivepublisher/tests/test_publishdistro.py
25+++ b/lib/lp/archivepublisher/tests/test_publishdistro.py
26@@ -9,7 +9,6 @@ from optparse import OptionValueError
27 import os
28 import shutil
29 import subprocess
30-import sys
31
32 import six
33 from storm.store import Store
34@@ -84,7 +83,7 @@ class TestPublishDistro(TestNativePublishingBase):
35 def runPublishDistroScript(self):
36 """Run publish-distro.py, returning the result and output."""
37 script = os.path.join(config.root, "scripts", "publish-distro.py")
38- args = [sys.executable, script, "-v", "-d", "ubuntutest"]
39+ args = [script, "-v", "-d", "ubuntutest"]
40 process = subprocess.Popen(
41 args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
42 stdout, stderr = process.communicate()
43diff --git a/lib/lp/archiveuploader/tests/test_processupload.py b/lib/lp/archiveuploader/tests/test_processupload.py
44index 29917b5..ee6094a 100644
45--- a/lib/lp/archiveuploader/tests/test_processupload.py
46+++ b/lib/lp/archiveuploader/tests/test_processupload.py
47@@ -6,7 +6,6 @@ __metaclass__ = type
48 import os
49 import shutil
50 import subprocess
51-import sys
52 import tempfile
53 import unittest
54
55@@ -32,7 +31,7 @@ class TestProcessUpload(unittest.TestCase):
56 if extra_args is None:
57 extra_args = []
58 script = os.path.join(config.root, "scripts", "process-upload.py")
59- args = [sys.executable, script, "-vvv", self.queue_location]
60+ args = [script, "-vvv", self.queue_location]
61 args.extend(extra_args)
62 process = subprocess.Popen(
63 args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
64diff --git a/lib/lp/bugs/doc/cve-update.txt b/lib/lp/bugs/doc/cve-update.txt
65index 5ca5f00..8b5d910 100644
66--- a/lib/lp/bugs/doc/cve-update.txt
67+++ b/lib/lp/bugs/doc/cve-update.txt
68@@ -16,7 +16,6 @@ the case.
69 >>> import os.path
70 >>> import shutil
71 >>> import subprocess
72- >>> import sys
73 >>> import tempfile
74 >>> import transaction
75 >>> from lp.services.config import config
76@@ -45,7 +44,7 @@ Now run the cronscript.
77 ... shutil.copyfileobj(uncompressed, compressed)
78 ... url = 'file://%s' % compressed_path
79 ... process = subprocess.Popen(
80- ... [sys.executable, script, '-u', url],
81+ ... [script, '-u', url],
82 ... stdin=subprocess.PIPE, stdout=subprocess.PIPE,
83 ... stderr=subprocess.STDOUT, universal_newlines=True)
84 ... return process.communicate()
85diff --git a/lib/lp/services/librarianserver/tests/test_gc.py b/lib/lp/services/librarianserver/tests/test_gc.py
86index 31c3830..a488abb 100644
87--- a/lib/lp/services/librarianserver/tests/test_gc.py
88+++ b/lib/lp/services/librarianserver/tests/test_gc.py
89@@ -20,7 +20,6 @@ from subprocess import (
90 Popen,
91 STDOUT,
92 )
93-import sys
94 import tempfile
95
96 from fixtures import MockPatchObject
97@@ -570,7 +569,7 @@ class TestLibrarianGarbageCollectionBase:
98 script_path = os.path.join(
99 config.root, 'cronscripts', 'librarian-gc.py'
100 )
101- cmd = [sys.executable, script_path, '-q']
102+ cmd = [script_path, '-q']
103 process = Popen(
104 cmd, stdout=PIPE, stderr=STDOUT, stdin=PIPE,
105 universal_newlines=True)
106@@ -1291,7 +1290,7 @@ class TestBlobCollection(TestCase):
107 script_path = os.path.join(
108 config.root, 'cronscripts', 'librarian-gc.py'
109 )
110- cmd = [sys.executable, script_path, '-q']
111+ cmd = [script_path, '-q']
112 process = Popen(
113 cmd, stdout=PIPE, stderr=STDOUT, stdin=PIPE,
114 universal_newlines=True)
115diff --git a/lib/lp/services/scripts/doc/launchpad-scripts.txt b/lib/lp/services/scripts/doc/launchpad-scripts.txt
116index 9a51be6..761052e 100644
117--- a/lib/lp/services/scripts/doc/launchpad-scripts.txt
118+++ b/lib/lp/services/scripts/doc/launchpad-scripts.txt
119@@ -12,13 +12,13 @@ LaunchpadScript. Unhandled exceptions from scripts are automatically
120 sent to the Python logging system. Cronscripts (scripts using
121 LaunchpadCronScript) also log warnings and and errors as OOPS reports.
122
123- >>> import os.path, subprocess, sys
124+ >>> import os.path, subprocess
125 >>> from lp.services.config import config
126 >>> cronscript_crash_path = os.path.join(
127 ... config.root, 'lib', 'lp', 'services', 'scripts', 'tests',
128 ... 'cronscript-crash.py')
129 >>> p = subprocess.Popen(
130- ... [sys.executable, cronscript_crash_path, '-vq'],
131+ ... [cronscript_crash_path, '-vq'],
132 ... stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
133 ... stdin=subprocess.PIPE, universal_newlines=True)
134 >>> print(p.communicate()[0])
135diff --git a/lib/lp/services/statistics/tests/test_update_stats.py b/lib/lp/services/statistics/tests/test_update_stats.py
136index 32550b8..9771580 100644
137--- a/lib/lp/services/statistics/tests/test_update_stats.py
138+++ b/lib/lp/services/statistics/tests/test_update_stats.py
139@@ -7,7 +7,6 @@ __metaclass__ = type
140
141 import os
142 import subprocess
143-import sys
144 import unittest
145
146 from zope.component import getUtility
147@@ -82,7 +81,7 @@ class UpdateStatsTest(unittest.TestCase):
148 self.layer.txn.commit()
149
150 # Run the update-stats.py script
151- cmd = [sys.executable, get_script(), '--quiet']
152+ cmd = [get_script(), '--quiet']
153 process = subprocess.Popen(
154 cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
155 stderr=subprocess.STDOUT, universal_newlines=True)
156@@ -263,7 +262,7 @@ class UpdateTranslationStatsTest(unittest.TestCase):
157
158 # Run update-stats.py script to see that we don't count the
159 # information in that template anymore.
160- cmd = [sys.executable, get_script(), '--quiet']
161+ cmd = [get_script(), '--quiet']
162 process = subprocess.Popen(
163 cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
164 stderr=subprocess.STDOUT)
165@@ -346,7 +345,7 @@ class UpdateTranslationStatsTest(unittest.TestCase):
166
167 # Run update-stats.py script to see that we don't count the
168 # information in the moz_english_pofile template.
169- cmd = [sys.executable, get_script(), '--quiet']
170+ cmd = [get_script(), '--quiet']
171 process = subprocess.Popen(
172 cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
173 stderr=subprocess.STDOUT)
174diff --git a/lib/lp/soyuz/doc/buildd-mass-retry.txt b/lib/lp/soyuz/doc/buildd-mass-retry.txt
175index bfc8726..03ec6f4 100644
176--- a/lib/lp/soyuz/doc/buildd-mass-retry.txt
177+++ b/lib/lp/soyuz/doc/buildd-mass-retry.txt
178@@ -3,7 +3,6 @@ Buildd-mass-retry behaviour
179
180 >>> import subprocess
181 >>> import os
182- >>> import sys
183 >>> from lp.services.config import config
184
185 'buildd-mass-retry' is a tool designed to retry a group of 'failed'
186@@ -31,7 +30,7 @@ See binarypackagebuild.txt for more information about IBuild.retry().
187 Passing only suite, request retry on all failed states:
188
189 >>> process = subprocess.Popen(
190- ... [sys.executable, script, "-v", "-NFDC", "-s", "hoary"],
191+ ... [script, "-v", "-NFDC", "-s", "hoary"],
192 ... stdout=subprocess.PIPE, stderr=subprocess.PIPE,
193 ... universal_newlines=True)
194 >>> stdout, stderr = process.communicate()
195@@ -70,7 +69,7 @@ Let's mark the build from the previous run superseded.
196 A new run doesn't pick it up.
197
198 >>> process = subprocess.Popen(
199- ... [sys.executable, script, "-v", "-NFDC", "-s", "hoary"],
200+ ... [script, "-v", "-NFDC", "-s", "hoary"],
201 ... stdout=subprocess.PIPE, stderr=subprocess.PIPE,
202 ... universal_newlines=True)
203 >>> stdout, stderr = process.communicate()
204@@ -97,10 +96,7 @@ Passing an architecture, which contains no failed build records,
205 nothing is done:
206
207 >>> process = subprocess.Popen(
208- ... [
209- ... sys.executable, script,
210- ... "-v", "-NFDC", "-s", "hoary", "-a", "hppa",
211- ... ],
212+ ... [script, "-v", "-NFDC", "-s", "hoary", "-a", "hppa"],
213 ... stdout=subprocess.PIPE, stderr=subprocess.PIPE,
214 ... universal_newlines=True)
215 >>> stdout, stderr = process.communicate()
216@@ -122,7 +118,7 @@ nothing is done:
217 Selecting only a specific failed state:
218
219 >>> process = subprocess.Popen(
220- ... [sys.executable, script, "-v", "-NF", "-s", "hoary"],
221+ ... [script, "-v", "-NF", "-s", "hoary"],
222 ... stdout=subprocess.PIPE, stderr=subprocess.PIPE,
223 ... universal_newlines=True)
224 >>> stdout, stderr = process.communicate()
225diff --git a/lib/lp/soyuz/doc/closing-bugs-from-changelogs.txt b/lib/lp/soyuz/doc/closing-bugs-from-changelogs.txt
226index 75f99ff..84f8a7c 100644
227--- a/lib/lp/soyuz/doc/closing-bugs-from-changelogs.txt
228+++ b/lib/lp/soyuz/doc/closing-bugs-from-changelogs.txt
229@@ -297,11 +297,10 @@ queue items have been processed.
230
231 >>> import os.path
232 >>> import subprocess
233- >>> import sys
234 >>> from lp.services.config import config
235 >>> script = os.path.join(config.root, "scripts/process-accepted.py")
236 >>> process = subprocess.Popen(
237- ... [sys.executable, script, "ubuntu"],
238+ ... [script, "ubuntu"],
239 ... stdout=subprocess.PIPE, stderr=subprocess.PIPE)
240 >>> stdout, stderr = process.communicate()
241 >>> process.returncode
242diff --git a/lib/lp/soyuz/doc/gina-multiple-arch.txt b/lib/lp/soyuz/doc/gina-multiple-arch.txt
243index 0bcc976..b19bdf1 100644
244--- a/lib/lp/soyuz/doc/gina-multiple-arch.txt
245+++ b/lib/lp/soyuz/doc/gina-multiple-arch.txt
246@@ -64,7 +64,7 @@ Check it was properly created and create its DistroArchSeriess.
247
248 Let's set up the filesystem:
249
250- >>> import subprocess, sys, os
251+ >>> import subprocess, os
252 >>> try:
253 ... os.unlink("/var/lock/launchpad-gina.lock")
254 ... except OSError:
255@@ -77,8 +77,7 @@ Let's set up the filesystem:
256 >>> path = os.path.join(os.getcwd(), relative_path)
257 >>> os.symlink(path, '/tmp/gina_test_archive')
258
259- >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q',
260- ... 'dapper', 'dapper-updates']
261+ >>> gina_proc = ['scripts/gina.py', '-q', 'dapper', 'dapper-updates']
262 >>> proc = subprocess.Popen(
263 ... gina_proc, stderr=subprocess.PIPE, universal_newlines=True)
264 >>> print(proc.stderr.read())
265diff --git a/lib/lp/soyuz/doc/gina.txt b/lib/lp/soyuz/doc/gina.txt
266index 894c39f..4cecccf 100644
267--- a/lib/lp/soyuz/doc/gina.txt
268+++ b/lib/lp/soyuz/doc/gina.txt
269@@ -109,7 +109,7 @@ And two completely broken packages:
270
271 Let's set up the filesystem:
272
273- >>> import subprocess, sys, os
274+ >>> import subprocess, os
275 >>> try:
276 ... os.unlink("/var/lock/launchpad-gina.lock")
277 ... except OSError:
278@@ -124,8 +124,7 @@ Let's set up the filesystem:
279
280 And give it a spin:
281
282- >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q',
283- ... 'hoary', 'breezy']
284+ >>> gina_proc = ['scripts/gina.py', '-q', 'hoary', 'breezy']
285 >>> proc = subprocess.Popen(
286 ... gina_proc, stderr=subprocess.PIPE, universal_newlines=True)
287
288@@ -528,8 +527,7 @@ packages that failed to import the last time. Overrides should also have
289 been updated for packages in breezy which have changed since the last
290 run.
291
292- >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q',
293- ... 'hoary', 'breezy']
294+ >>> gina_proc = ['scripts/gina.py', '-q', 'hoary', 'breezy']
295 >>> proc = subprocess.Popen(
296 ... gina_proc, stderr=subprocess.PIPE, universal_newlines=True)
297 >>> print(proc.stderr.read())
298@@ -661,7 +659,7 @@ First get a set of existing publishings for both source and binary:
299
300 Now run gina to import packages and convert them to partner:
301
302- >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q', 'partner']
303+ >>> gina_proc = ['scripts/gina.py', '-q', 'partner']
304 >>> proc = subprocess.Popen(
305 ... gina_proc, stderr=subprocess.PIPE, universal_newlines=True)
306 >>> proc.wait()
307@@ -764,8 +762,7 @@ Commit the changes and run the importer script.
308
309 >>> transaction.commit()
310
311- >>> gina_proc = [
312- ... sys.executable, 'scripts/gina.py', '-q', 'lenny']
313+ >>> gina_proc = ['scripts/gina.py', '-q', 'lenny']
314 >>> proc = subprocess.Popen(
315 ... gina_proc, stderr=subprocess.PIPE, universal_newlines=True)
316 >>> proc.wait()
317@@ -803,8 +800,7 @@ Processing multiple suites in the same batch
318 Both, 'lenny' and 'hoary' (as partner) will be processed in the same
319 batch.
320
321- >>> gina_proc = [
322- ... sys.executable, 'scripts/gina.py', 'lenny', 'partner']
323+ >>> gina_proc = ['scripts/gina.py', 'lenny', 'partner']
324 >>> proc = subprocess.Popen(
325 ... gina_proc, stderr=subprocess.PIPE, universal_newlines=True)
326
327@@ -825,7 +821,7 @@ Other tests
328
329 For kicks, finally, run gina on a configured but incomplete archive:
330
331- >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q', 'bogus']
332+ >>> gina_proc = ['scripts/gina.py', '-q', 'bogus']
333 >>> proc = subprocess.Popen(
334 ... gina_proc, stderr=subprocess.PIPE, universal_newlines=True)
335 >>> print(proc.stderr.read())
336diff --git a/lib/lp/soyuz/doc/package-cache-script.txt b/lib/lp/soyuz/doc/package-cache-script.txt
337index 8b45e2f..6f75192 100644
338--- a/lib/lp/soyuz/doc/package-cache-script.txt
339+++ b/lib/lp/soyuz/doc/package-cache-script.txt
340@@ -37,8 +37,7 @@ Normal operation produces INFO level information about the
341 distribution and respective distroseriess considered in stderr.
342
343 >>> import subprocess
344- >>> import sys
345- >>> process = subprocess.Popen([sys.executable, script],
346+ >>> process = subprocess.Popen([script],
347 ... stdout=subprocess.PIPE,
348 ... stderr=subprocess.PIPE,
349 ... universal_newlines=True)
350diff --git a/lib/lp/soyuz/doc/soyuz-upload.txt b/lib/lp/soyuz/doc/soyuz-upload.txt
351index 2b3ff99..475d449 100644
352--- a/lib/lp/soyuz/doc/soyuz-upload.txt
353+++ b/lib/lp/soyuz/doc/soyuz-upload.txt
354@@ -233,7 +233,7 @@ NascentUpload in the 'sync' policy in the future.
355 Now we are ready to process the uploaded packages.
356 This is done by running process-upload.py on each upload directory.
357
358- >>> import subprocess, sys
359+ >>> import subprocess
360 >>> script = os.path.join(config.root, "scripts/process-upload.py")
361
362 First, we will test process-upload's -J option, which limits which uploads
363@@ -243,7 +243,7 @@ just upload number 1.
364 >>> upload_dir_1_path = get_upload_dir(1)
365 >>> upload_dir_1_name = os.path.basename(upload_dir_1_path)
366 >>> process = subprocess.Popen([
367- ... sys.executable, script, "--no-mails", "-vv",
368+ ... script, "--no-mails", "-vv",
369 ... "-C", "sync", "-J", upload_dir_1_name, temp_dir,
370 ... ],
371 ... stdout=subprocess.PIPE,
372@@ -267,7 +267,7 @@ the other three still in incoming.
373 Now continue with the real upload.
374
375 >>> process = subprocess.Popen([
376- ... sys.executable, script, "--no-mails", "-vv",
377+ ... script, "--no-mails", "-vv",
378 ... "-C", "sync", temp_dir,
379 ... ],
380 ... stdout=subprocess.PIPE,
381@@ -431,8 +431,7 @@ Now we process the accepted queue items, one more time.
382
383 >>> transaction.commit()
384 >>> script = os.path.join(config.root, "scripts", "process-accepted.py")
385- >>> process = subprocess.Popen(
386- ... [sys.executable, script, "-d", "ubuntutest", "-q"])
387+ >>> process = subprocess.Popen([script, "-d", "ubuntutest", "-q"])
388 >>> process.wait()
389 0
390
391@@ -456,8 +455,7 @@ These packages must now be in the publishing history. Let's check it.
392 Invoke Publisher script against the 'ubuntutest' distribution:
393
394 >>> script = os.path.join(config.root, "scripts", "publish-distro.py")
395- >>> process = subprocess.Popen([sys.executable, script, "-vvCq",
396- ... "-d", "ubuntutest"],
397+ >>> process = subprocess.Popen([script, "-vvCq", "-d", "ubuntutest"],
398 ... stdout=subprocess.PIPE,
399 ... stderr=subprocess.PIPE,
400 ... universal_newlines=True)
401@@ -556,8 +554,7 @@ Force database changes, so they can be used by the external script properly.
402 Invoke Publisher script again to land our changes in the archive
403
404 >>> script = os.path.join(config.root, "scripts", "publish-distro.py")
405- >>> process = subprocess.Popen([sys.executable, script, "-vvCq",
406- ... "-d", "ubuntutest"],
407+ >>> process = subprocess.Popen([script, "-vvCq", "-d", "ubuntutest"],
408 ... stdout=subprocess.PIPE,
409 ... stderr=subprocess.PIPE,
410 ... universal_newlines=True)
411diff --git a/lib/lp/soyuz/scripts/tests/test_add_missing_builds.py b/lib/lp/soyuz/scripts/tests/test_add_missing_builds.py
412index efcd9a3..9d54629 100644
413--- a/lib/lp/soyuz/scripts/tests/test_add_missing_builds.py
414+++ b/lib/lp/soyuz/scripts/tests/test_add_missing_builds.py
415@@ -5,7 +5,6 @@
416
417 import os
418 import subprocess
419-import sys
420
421 from zope.component import getUtility
422
423@@ -66,7 +65,7 @@ class TestAddMissingBuilds(TestCaseWithFactory):
424 test_args = []
425 script = os.path.join(
426 config.root, "scripts", "add-missing-builds.py")
427- args = [sys.executable, script]
428+ args = [script]
429 args.extend(test_args)
430 process = subprocess.Popen(
431 args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
432diff --git a/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py b/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py
433index 87a4a57..92b2ac6 100644
434--- a/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py
435+++ b/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py
436@@ -5,7 +5,6 @@ __metaclass__ = type
437
438 import os
439 import subprocess
440-import sys
441
442 from zope.component import getUtility
443
444@@ -44,7 +43,7 @@ class TestObsoleteDistroseriesScript(TestCase):
445 script = os.path.join(
446 config.root, "scripts", "ftpmaster-tools",
447 "obsolete-distroseries.py")
448- args = [sys.executable, script, '-y']
449+ args = [script, '-y']
450 args.extend(extra_args)
451 process = subprocess.Popen(
452 args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
453diff --git a/lib/lp/soyuz/scripts/tests/test_populatearchive.py b/lib/lp/soyuz/scripts/tests/test_populatearchive.py
454index f30eb4b..97baf62 100644
455--- a/lib/lp/soyuz/scripts/tests/test_populatearchive.py
456+++ b/lib/lp/soyuz/scripts/tests/test_populatearchive.py
457@@ -6,7 +6,6 @@ __metaclass__ = type
458 from datetime import datetime
459 import os
460 import subprocess
461-import sys
462 import time
463
464 from zope.component import getUtility
465@@ -70,7 +69,7 @@ class TestPopulateArchiveScript(TestCaseWithFactory):
466 extra_args = []
467 script = os.path.join(
468 config.root, "scripts", "populate-archive.py")
469- args = [sys.executable, script, '-y']
470+ args = [script, '-y']
471 args.extend(extra_args)
472 process = subprocess.Popen(
473 args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
474diff --git a/lib/lp/translations/doc/poexport-request.txt b/lib/lp/translations/doc/poexport-request.txt
475index ac5ed50..ba2b666 100644
476--- a/lib/lp/translations/doc/poexport-request.txt
477+++ b/lib/lp/translations/doc/poexport-request.txt
478@@ -11,10 +11,6 @@ serve those requests properly.
479 ... is_valid_mofile)
480 >>> from lp.testing.mail_helpers import pop_notifications, print_emails
481
482-This is a dummy logger class to capture the export's log messages.
483-
484- >>> import sys
485-
486 Here's somebody to make a request.
487
488 >>> person = factory.makePerson(
489@@ -252,7 +248,7 @@ The script is run.
490
491 >>> import subprocess
492 >>> process = subprocess.Popen([
493- ... sys.executable, 'cronscripts/rosetta-export-queue.py', '-v'
494+ ... 'cronscripts/rosetta-export-queue.py', '-v'
495 ... ], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
496 ... stderr=subprocess.STDOUT, universal_newlines=True,
497 ... )
498diff --git a/lib/lp/translations/doc/rosetta-poimport-script.txt b/lib/lp/translations/doc/rosetta-poimport-script.txt
499index 680c6a5..58ebb6b 100644
500--- a/lib/lp/translations/doc/rosetta-poimport-script.txt
501+++ b/lib/lp/translations/doc/rosetta-poimport-script.txt
502@@ -78,11 +78,10 @@ Now we run the import script, making sure that the DB user it runs under
503 has enough privileges for the script to run to completion.
504
505 >>> import os
506- >>> import sys
507 >>> import subprocess
508 >>> script = os.path.join(config.root, "cronscripts",
509 ... "rosetta-poimport.py")
510- >>> process = subprocess.Popen([sys.executable, script],
511+ >>> process = subprocess.Popen([script],
512 ... stdout=subprocess.PIPE,
513 ... stderr=subprocess.PIPE,
514 ... universal_newlines=True)
515diff --git a/lib/lp/translations/doc/sourcepackagerelease-translations.txt b/lib/lp/translations/doc/sourcepackagerelease-translations.txt
516index 42459a1..8bf485b 100644
517--- a/lib/lp/translations/doc/sourcepackagerelease-translations.txt
518+++ b/lib/lp/translations/doc/sourcepackagerelease-translations.txt
519@@ -99,9 +99,9 @@ Now, we need to do the final import. It's done as a two steps procedure.
520
521 The first one, approves the import.
522
523- >>> import subprocess, sys
524+ >>> import subprocess
525 >>> process = subprocess.Popen([
526- ... sys.executable, 'cronscripts/rosetta-approve-imports.py'
527+ ... 'cronscripts/rosetta-approve-imports.py'
528 ... ], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
529 ... stderr=subprocess.STDOUT, universal_newlines=True,
530 ... )
531@@ -115,9 +115,8 @@ The first one, approves the import.
532
533 The second one, executes the import.
534
535- >>> import subprocess, sys
536 >>> process = subprocess.Popen([
537- ... sys.executable, 'cronscripts/rosetta-poimport.py'
538+ ... 'cronscripts/rosetta-poimport.py'
539 ... ], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
540 ... stderr=subprocess.STDOUT, universal_newlines=True,
541 ... )

Subscribers

People subscribed via source and target branches

to status/vote changes: