mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Syntax cleanup.
This commit is contained in:
parent
3f8ab965f7
commit
02ea12b291
7 changed files with 9 additions and 11 deletions
|
@ -79,7 +79,7 @@ def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None):
|
|||
name_in_zip = os.path.basename(script_name)
|
||||
zip_file.write(script_name, name_in_zip)
|
||||
zip_file.close()
|
||||
#if test.test_support.verbose:
|
||||
#if test.support.verbose:
|
||||
# zip_file = zipfile.ZipFile(zip_name, 'r')
|
||||
# print 'Contents of %r:' % zip_name
|
||||
# zip_file.printdir()
|
||||
|
@ -114,7 +114,7 @@ def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
|
|||
zip_file.close()
|
||||
for name in unlink:
|
||||
os.unlink(name)
|
||||
#if test.test_support.verbose:
|
||||
#if test.support.verbose:
|
||||
# zip_file = zipfile.ZipFile(zip_name, 'r')
|
||||
# print 'Contents of %r:' % zip_name
|
||||
# zip_file.printdir()
|
||||
|
|
|
@ -16,7 +16,7 @@ def isint(x):
|
|||
|
||||
def isnum(x):
|
||||
"""Test whether an object is an instance of a built-in numeric type."""
|
||||
for T in int, int, float, complex:
|
||||
for T in int, float, complex:
|
||||
if isinstance(x, T):
|
||||
return 1
|
||||
return 0
|
||||
|
|
|
@ -18,14 +18,14 @@ class PowTest(unittest.TestCase):
|
|||
self.assertEquals(pow(2, i), pow2)
|
||||
if i != 30 : pow2 = pow2*2
|
||||
|
||||
for othertype in int, int:
|
||||
for othertype in (int,):
|
||||
for i in list(range(-10, 0)) + list(range(1, 10)):
|
||||
ii = type(i)
|
||||
for j in range(1, 11):
|
||||
jj = -othertype(j)
|
||||
pow(ii, jj)
|
||||
|
||||
for othertype in int, int, float:
|
||||
for othertype in int, float:
|
||||
for i in range(1, 100):
|
||||
zero = type(0)
|
||||
exp = -othertype(i/10.0)
|
||||
|
|
|
@ -86,7 +86,6 @@ class SysModuleTest(unittest.TestCase):
|
|||
# Python/pythonrun.c::PyErr_PrintEx() is tricky.
|
||||
|
||||
def test_exit(self):
|
||||
import subprocess
|
||||
|
||||
self.assertRaises(TypeError, sys.exit, 42, 42)
|
||||
|
||||
|
@ -529,7 +528,6 @@ class SysModuleTest(unittest.TestCase):
|
|||
sys._clear_type_cache()
|
||||
|
||||
def test_ioencoding(self):
|
||||
import subprocess
|
||||
env = dict(os.environ)
|
||||
|
||||
# Test character: cent sign, encoded as 0x4A (ASCII J) in CP424,
|
||||
|
@ -551,7 +549,7 @@ class SysModuleTest(unittest.TestCase):
|
|||
# Issue #7774: Ensure that sys.executable is an empty string if argv[0]
|
||||
# has been set to an non existent program name and Python is unable to
|
||||
# retrieve the real program name
|
||||
import subprocess
|
||||
|
||||
# For a normal installation, it should work without 'cwd'
|
||||
# argument. For test runs in the build directory, see #7774.
|
||||
python_dir = os.path.dirname(os.path.realpath(sys.executable))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue