[Python-checkins] r42927 - in python/trunk/Lib: ctypes/__init__.py ctypes/_endian.py ctypes/_loader.py ctypes/test/__init__.py ctypes/test/test_array_in_pointer.py ctypes/test/test_bitfields.py ctypes/test/test_buffers.py ctypes/test/test_byteswap.py ctypes/test/test_callbacks.py ctypes/test/test_funcptr.py ctypes/test/test_functions.py ctypes/test/test_keeprefs.py ctypes/test/test_macholib.py ctypes/test/test_numbers.py ctypes/test/test_parameters.py ctypes/test/test_pointers.py ctypes/test/test_posix.py ctypes/test/test_prototypes.py ctypes/test/test_refcounts.py ctypes/test/test_returnfuncptrs.py ctypes/test/test_strings.py ctypes/test/test_structures.py ctypes/test/test_win32.py distutils/command/bdist_msi.py test/test_importhooks.py

tim.peters python-checkins at python.org
Thu Mar 9 02:15:08 CET 2006


Author: tim.peters
Date: Thu Mar 9 02:15:05 2006
New Revision: 42927
Modified:
 python/trunk/Lib/ctypes/__init__.py
 python/trunk/Lib/ctypes/_endian.py
 python/trunk/Lib/ctypes/_loader.py
 python/trunk/Lib/ctypes/test/__init__.py
 python/trunk/Lib/ctypes/test/test_array_in_pointer.py
 python/trunk/Lib/ctypes/test/test_bitfields.py
 python/trunk/Lib/ctypes/test/test_buffers.py
 python/trunk/Lib/ctypes/test/test_byteswap.py
 python/trunk/Lib/ctypes/test/test_callbacks.py
 python/trunk/Lib/ctypes/test/test_funcptr.py
 python/trunk/Lib/ctypes/test/test_functions.py
 python/trunk/Lib/ctypes/test/test_keeprefs.py
 python/trunk/Lib/ctypes/test/test_macholib.py
 python/trunk/Lib/ctypes/test/test_numbers.py
 python/trunk/Lib/ctypes/test/test_parameters.py
 python/trunk/Lib/ctypes/test/test_pointers.py
 python/trunk/Lib/ctypes/test/test_posix.py
 python/trunk/Lib/ctypes/test/test_prototypes.py
 python/trunk/Lib/ctypes/test/test_refcounts.py
 python/trunk/Lib/ctypes/test/test_returnfuncptrs.py
 python/trunk/Lib/ctypes/test/test_strings.py
 python/trunk/Lib/ctypes/test/test_structures.py
 python/trunk/Lib/ctypes/test/test_win32.py
 python/trunk/Lib/distutils/command/bdist_msi.py
 python/trunk/Lib/test/test_importhooks.py
Log:
Whitespace normalization.
Modified: python/trunk/Lib/ctypes/__init__.py
==============================================================================
--- python/trunk/Lib/ctypes/__init__.py	(original)
+++ python/trunk/Lib/ctypes/__init__.py	Thu Mar 9 02:15:05 2006
@@ -76,13 +76,13 @@
 _c_functype_cache = {}
 def CFUNCTYPE(restype, *argtypes):
 """CFUNCTYPE(restype, *argtypes) -> function prototype.
- 
+
 restype: the result type
 argtypes: a sequence specifying the argument types
- 
+
 The function prototype can be called in three ways to create a
 callable object:
- 
+
 prototype(funct) - returns a C callable function calling funct
 prototype(vtbl_index, method_name[, paramflags]) - a Python callable that calls a COM method
 prototype(funct_name, dll[, paramflags]) - a Python callable that calls an exported function in a dll
@@ -139,7 +139,7 @@
 
 class c_ulong(_SimpleCData):
 _type_ = "L"
- 
+
 if _calcsize("i") == _calcsize("l"):
 # if int and long have the same size, make c_int an alias for c_long
 c_int = c_long
@@ -153,7 +153,7 @@
 
 class c_float(_SimpleCData):
 _type_ = "f"
- 
+
 class c_double(_SimpleCData):
 _type_ = "d"
 
@@ -327,7 +327,7 @@
 _restype_ = c_int # default, can be overridden in instances
 
 if _os.name in ("nt", "ce"):
- 
+
 class WinDLL(CDLL):
 """This class represents a dll exporting functions using the
 Windows stdcall calling convention.
@@ -351,7 +351,7 @@
 # doesn't have a way to raise an exception in the caller's
 # frame).
 _check_retval_ = _check_HRESULT
- 
+
 class OleDLL(CDLL):
 """This class represents a dll exporting functions using the
 Windows stdcall calling convention, and returning HRESULT.
@@ -424,7 +424,7 @@
 
 Return the string at addr."""
 return _wstring_at(ptr, size)
- 
+
 
 if _os.name == "nt": # COM stuff
 def DllGetClassObject(rclsid, riid, ppv):
Modified: python/trunk/Lib/ctypes/_endian.py
==============================================================================
--- python/trunk/Lib/ctypes/_endian.py	(original)
+++ python/trunk/Lib/ctypes/_endian.py	Thu Mar 9 02:15:05 2006
@@ -55,4 +55,3 @@
 
 else:
 raise RuntimeError("Invalid byteorder")
-
Modified: python/trunk/Lib/ctypes/_loader.py
==============================================================================
--- python/trunk/Lib/ctypes/_loader.py	(original)
+++ python/trunk/Lib/ctypes/_loader.py	Thu Mar 9 02:15:05 2006
@@ -151,7 +151,7 @@
 except ValueError:
 raise OSError("Library %s could not be found" % libname)
 return self.load_library(pathname, mode)
- 
+
 elif os.name == "posix":
 # Posix
 def _plat_load_version(self, name, version, mode):
Modified: python/trunk/Lib/ctypes/test/__init__.py
==============================================================================
--- python/trunk/Lib/ctypes/test/__init__.py	(original)
+++ python/trunk/Lib/ctypes/test/__init__.py	Thu Mar 9 02:15:05 2006
@@ -83,7 +83,7 @@
 ptc = ctypes._pointer_type_cache.copy()
 cfc = ctypes._c_functype_cache.copy()
 wfc = ctypes._win_functype_cache.copy()
- 
+
 # when searching for refcount leaks, we have to manually reset any
 # caches that ctypes has.
 def cleanup():
Modified: python/trunk/Lib/ctypes/test/test_array_in_pointer.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_array_in_pointer.py	(original)
+++ python/trunk/Lib/ctypes/test/test_array_in_pointer.py	Thu Mar 9 02:15:05 2006
@@ -8,7 +8,7 @@
 # between the bytes.
 h = hexlify(buffer(obj))
 return re.sub(r"(..)", r"1円-", h)[:-1]
- 
+
 
 class Value(Structure):
 _fields_ = [("val", c_byte)]
Modified: python/trunk/Lib/ctypes/test/test_bitfields.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_bitfields.py	(original)
+++ python/trunk/Lib/ctypes/test/test_bitfields.py	Thu Mar 9 02:15:05 2006
@@ -15,7 +15,7 @@
 ("G", c_int, 7),
 ("H", c_int, 8),
 ("I", c_int, 9),
- 
+
 ("M", c_short, 1),
 ("N", c_short, 2),
 ("O", c_short, 3),
@@ -62,7 +62,7 @@
 x = X()
 x.a, x.b, x.c = -1, 7, -1
 self.failUnlessEqual((x.a, x.b, x.c), (-1, 7, -1))
- 
+
 def test_ulonglong(self):
 class X(Structure):
 _fields_ = [("a", c_ulonglong, 1),
@@ -79,7 +79,7 @@
 for c_typ in signed_int_types:
 class X(Structure):
 _fields_ = [("dummy", c_typ),
- ("a", c_typ, 3), 
+ ("a", c_typ, 3),
 ("b", c_typ, 3),
 ("c", c_typ, 1)]
 self.failUnlessEqual(sizeof(X), sizeof(c_typ)*2)
Modified: python/trunk/Lib/ctypes/test/test_buffers.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_buffers.py	(original)
+++ python/trunk/Lib/ctypes/test/test_buffers.py	Thu Mar 9 02:15:05 2006
@@ -8,14 +8,14 @@
 self.failUnlessEqual(len(b), 32)
 self.failUnlessEqual(sizeof(b), 32 * sizeof(c_char))
 self.failUnless(type(b[0]) is str)
- 
+
 b = create_string_buffer("abc")
 self.failUnlessEqual(len(b), 4) # trailing nul char
 self.failUnlessEqual(sizeof(b), 4 * sizeof(c_char))
 self.failUnless(type(b[0]) is str)
 self.failUnlessEqual(b[0], "a")
 self.failUnlessEqual(b[:], "abc0円")
- 
+
 def test_string_conversion(self):
 b = create_string_buffer(u"abc")
 self.failUnlessEqual(len(b), 4) # trailing nul char
Modified: python/trunk/Lib/ctypes/test/test_byteswap.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_byteswap.py	(original)
+++ python/trunk/Lib/ctypes/test/test_byteswap.py	Thu Mar 9 02:15:05 2006
@@ -11,7 +11,7 @@
 # byte order, and a __ctype_le__ attribute that is the same type in
 # LITTLE ENDIAN byte order.
 #
-# For Structures and Unions, these types are created on demand. 
+# For Structures and Unions, these types are created on demand.
 
 class Test(unittest.TestCase):
 def X_test(self):
Modified: python/trunk/Lib/ctypes/test/test_callbacks.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_callbacks.py	(original)
+++ python/trunk/Lib/ctypes/test/test_callbacks.py	Thu Mar 9 02:15:05 2006
@@ -3,7 +3,7 @@
 import _ctypes_test
 
 class Callbacks(unittest.TestCase):
- functype = CFUNCTYPE 
+ functype = CFUNCTYPE
 
 ## def tearDown(self):
 ## import gc
@@ -130,7 +130,7 @@
 
 result = integrate(0.0, 1.0, CALLBACK(func), 10)
 diff = abs(result - 1./3.)
- 
+
 self.failUnless(diff < 0.01, "%s not less than 0.01" % diff)
 
 ################################################################
Modified: python/trunk/Lib/ctypes/test/test_funcptr.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_funcptr.py	(original)
+++ python/trunk/Lib/ctypes/test/test_funcptr.py	Thu Mar 9 02:15:05 2006
@@ -122,6 +122,6 @@
 self.failUnlessEqual(strtok(None, "\n"), "b")
 self.failUnlessEqual(strtok(None, "\n"), "c")
 self.failUnlessEqual(strtok(None, "\n"), None)
- 
+
 if __name__ == '__main__':
 unittest.main()
Modified: python/trunk/Lib/ctypes/test/test_functions.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_functions.py	(original)
+++ python/trunk/Lib/ctypes/test/test_functions.py	Thu Mar 9 02:15:05 2006
@@ -28,14 +28,14 @@
 # But in early versions of _ctypes.c, the result of tp_new
 # wasn't checked, and it even crashed Python.
 # Found by Greg Chapman.
- 
+
 try:
 class X(object, Array):
 _length_ = 5
 _type_ = "i"
 except TypeError:
 pass
- 
+
 
 from _ctypes import _Pointer
 try:
@@ -105,7 +105,7 @@
 result = f(1, 2, 3, 4, 5.0, 6.0)
 self.failUnlessEqual(result, 21)
 self.failUnlessEqual(type(result), int)
- 
+
 result = f(1, 2, 3, 0x10004, 5.0, 6.0)
 self.failUnlessEqual(result, 21)
 self.failUnlessEqual(type(result), int)
@@ -124,7 +124,7 @@
 result = f(-1, -2, -3, -4, -5.0, -6.0)
 self.failUnlessEqual(result, -21)
 self.failUnlessEqual(type(result), float)
- 
+
 def test_doubleresult(self):
 f = dll._testfunc_d_bhilfd
 f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double]
@@ -136,7 +136,7 @@
 result = f(-1, -2, -3, -4, -5.0, -6.0)
 self.failUnlessEqual(result, -21)
 self.failUnlessEqual(type(result), float)
- 
+
 def test_longlongresult(self):
 try:
 c_longlong
@@ -226,7 +226,7 @@
 self.failUnlessEqual(args, expected)
 
 ################################################################
- 
+
 
 def test_callbacks(self):
 f = dll._testfunc_callback_i_if
@@ -237,7 +237,7 @@
 def callback(value):
 #print "called back with", value
 return value
- 
+
 cb = MyCallback(callback)
 result = f(-10, cb)
 self.failUnlessEqual(result, -18)
@@ -247,7 +247,7 @@
 cb = MyCallback(callback)
 result = f(-10, cb)
 self.failUnlessEqual(result, -18)
- 
+
 AnotherCallback = WINFUNCTYPE(c_int, c_int, c_int, c_int, c_int)
 
 # check that the prototype works: we call f with wrong
@@ -271,7 +271,7 @@
 #print "called back with", value
 self.failUnlessEqual(type(value), int)
 return value
- 
+
 cb = MyCallback(callback)
 result = f(-10, cb)
 self.failUnlessEqual(result, -18)
Modified: python/trunk/Lib/ctypes/test/test_keeprefs.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_keeprefs.py	(original)
+++ python/trunk/Lib/ctypes/test/test_keeprefs.py	Thu Mar 9 02:15:05 2006
@@ -130,7 +130,7 @@
 ("b", POINTER(POINT))]
 r = RECT()
 p1 = POINT(1, 2)
- 
+
 r.a = pointer(p1)
 r.b = pointer(p1)
 ## from pprint import pprint as pp
Modified: python/trunk/Lib/ctypes/test/test_macholib.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_macholib.py	(original)
+++ python/trunk/Lib/ctypes/test/test_macholib.py	Thu Mar 9 02:15:05 2006
@@ -36,13 +36,13 @@
 from ctypes.macholib.dyld import dyld_find
 
 def find_lib(name):
- possible = ['lib'+name+'.dylib', name+'.dylib', name+'.framework/'+name]
- for dylib in possible:
- try:
- return os.path.realpath(dyld_find(dylib))
- except ValueError:
- pass
- raise ValueError, "%s not found" % (name,)
+ possible = ['lib'+name+'.dylib', name+'.dylib', name+'.framework/'+name]
+ for dylib in possible:
+ try:
+ return os.path.realpath(dyld_find(dylib))
+ except ValueError:
+ pass
+ raise ValueError, "%s not found" % (name,)
 
 class MachOTest(unittest.TestCase):
 if sys.platform == "darwin":
Modified: python/trunk/Lib/ctypes/test/test_numbers.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_numbers.py	(original)
+++ python/trunk/Lib/ctypes/test/test_numbers.py	Thu Mar 9 02:15:05 2006
@@ -34,14 +34,14 @@
 else:
 unsigned_types.append(c_ulonglong)
 signed_types.append(c_longlong)
- 
+
 unsigned_ranges = valid_ranges(*unsigned_types)
 signed_ranges = valid_ranges(*signed_types)
 
 ################################################################
 
 class NumberTestCase(unittest.TestCase):
- 
+
 def test_default_init(self):
 # default values are set to zero
 for t in signed_types + unsigned_types + float_types:
@@ -132,7 +132,7 @@
 # and alignment of an instance
 self.failUnlessEqual((code, alignment(t())),
 (code, align))
- 
+
 def test_int_from_address(self):
 from array import array
 for t in signed_types + unsigned_types:
@@ -152,7 +152,7 @@
 # changing the value at the memory location changes v's value also
 a[0] = 42
 self.failUnlessEqual(v.value, a[0])
- 
+
 
 def test_float_from_address(self):
 from array import array
@@ -168,7 +168,7 @@
 def test_char_from_address(self):
 from ctypes import c_char
 from array import array
- 
+
 a = array('c', 'x')
 v = c_char.from_address(a.buffer_info()[0])
 self.failUnlessEqual(v.value, a[0])
@@ -185,7 +185,7 @@
 
 ## def test_perf(self):
 ## check_perf()
- 
+
 from ctypes import _SimpleCData
 class c_int_S(_SimpleCData):
 _type_ = "i"
@@ -227,7 +227,7 @@
 # c_int(): 3.35 us
 # c_int(999): 3.34 us
 # c_int_S(): 3.23 us
-# c_int_S(999): 3.24 us 
+# c_int_S(999): 3.24 us
 
 # Python 2.2 -OO, win2k, P4 700 MHz:
 #
Modified: python/trunk/Lib/ctypes/test/test_parameters.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_parameters.py	(original)
+++ python/trunk/Lib/ctypes/test/test_parameters.py	Thu Mar 9 02:15:05 2006
@@ -18,7 +18,7 @@
 pass
 else:
 set_conversion_mode(*self.prev_conv_mode)
- 
+
 
 def test_subclasses(self):
 from ctypes import c_void_p, c_char_p
Modified: python/trunk/Lib/ctypes/test/test_pointers.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_pointers.py	(original)
+++ python/trunk/Lib/ctypes/test/test_pointers.py	Thu Mar 9 02:15:05 2006
@@ -11,7 +11,7 @@
 class PointersTestCase(unittest.TestCase):
 
 def test_pointer_crash(self):
- 
+
 class A(POINTER(c_ulong)):
 pass
 
@@ -84,7 +84,7 @@
 ## print self.result
 doit(callback)
 ## print self.result
- 
+
 def test_basics(self):
 from operator import delitem
 for ct, pt in zip(ctype_types, python_types):
@@ -132,7 +132,7 @@
 self.assertRaises(TypeError, len, p)
 self.failUnlessEqual(p[0], 42)
 self.failUnlessEqual(p.contents.value, 42)
- 
+
 def test_incomplete(self):
 lpcell = POINTER("cell")
 class cell(Structure):
@@ -166,6 +166,6 @@
 result = func( byref(argc), argv )
 assert result == 'world', result
 
- 
+
 if __name__ == '__main__':
 unittest.main()
Modified: python/trunk/Lib/ctypes/test/test_posix.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_posix.py	(original)
+++ python/trunk/Lib/ctypes/test/test_posix.py	Thu Mar 9 02:15:05 2006
@@ -10,7 +10,7 @@
 def test_GL(self):
 cdll.load('libGL.so', mode=RTLD_GLOBAL)
 cdll.load('libGLU.so')
- 
+
 ##if os.name == "posix" and sys.platform != "darwin":
 
 ## # On platforms where the default shared library suffix is '.so',
Modified: python/trunk/Lib/ctypes/test/test_prototypes.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_prototypes.py	(original)
+++ python/trunk/Lib/ctypes/test/test_prototypes.py	Thu Mar 9 02:15:05 2006
@@ -44,7 +44,7 @@
 
 func.argtypes = POINTER(c_int),
 self.failUnlessEqual(addressof(ci), func(byref(ci)))
- 
+
 func.argtypes = c_char_p,
 self.assertRaises(ArgumentError, func, byref(ci))
 
@@ -73,7 +73,7 @@
 func = testdll._testfunc_p_p
 func.restype = c_char_p
 func.argtypes = c_char_p,
- 
+
 self.failUnlessEqual(None, func(None))
 self.failUnlessEqual("123", func("123"))
 self.failUnlessEqual(None, func(c_char_p(None)))
Modified: python/trunk/Lib/ctypes/test/test_refcounts.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_refcounts.py	(original)
+++ python/trunk/Lib/ctypes/test/test_refcounts.py	Thu Mar 9 02:15:05 2006
@@ -48,7 +48,7 @@
 # and may release it again
 del f
 self.failUnless(grc(func) >= 2)
- 
+
 # but now it must be gone
 gc.collect()
 self.failUnless(grc(func) == 2)
@@ -57,14 +57,14 @@
 _fields_ = [("a", OtherCallback)]
 x = X()
 x.a = OtherCallback(func)
- 
+
 # the CFuncPtr instance holds atr least one refcount on func:
 self.failUnless(grc(func) > 2)
 
 # and may release it again
 del x
 self.failUnless(grc(func) >= 2)
- 
+
 # and now it must be gone again
 gc.collect()
 self.failUnlessEqual(grc(func), 2)
@@ -80,7 +80,7 @@
 del f
 gc.collect()
 self.failUnlessEqual(grc(func), 2)
- 
+
 class AnotherLeak(unittest.TestCase):
 def test_callback(self):
 import sys
@@ -89,7 +89,7 @@
 def func(a, b):
 return a * b * 2
 f = proto(func)
- 
+
 a = sys.getrefcount(ctypes.c_int)
 f(1, 2)
 self.failUnlessEqual(sys.getrefcount(ctypes.c_int), a)
Modified: python/trunk/Lib/ctypes/test/test_returnfuncptrs.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_returnfuncptrs.py	(original)
+++ python/trunk/Lib/ctypes/test/test_returnfuncptrs.py	Thu Mar 9 02:15:05 2006
@@ -16,7 +16,7 @@
 self.failUnlessEqual(strchr("abcdef", "x"), None)
 self.assertRaises(ArgumentError, strchr, "abcdef", 3)
 self.assertRaises(TypeError, strchr, "abcdef")
- 
+
 def test_without_prototype(self):
 dll = cdll.load(_ctypes_test.__file__)
 get_strchr = dll.get_strchr
Modified: python/trunk/Lib/ctypes/test/test_strings.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_strings.py	(original)
+++ python/trunk/Lib/ctypes/test/test_strings.py	Thu Mar 9 02:15:05 2006
@@ -46,7 +46,7 @@
 BUF = c_char * 4
 buf = BUF()
 ## print c_char_p.from_param(buf)
- 
+
 def test_param_2(self):
 BUF = c_char * 4
 buf = BUF()
@@ -103,9 +103,9 @@
 
 def XX_test_sized_strings(self):
 
- # New in releases later than 0.4.0: 
+ # New in releases later than 0.4.0:
 self.assertRaises(TypeError, c_string, None)
- 
+
 # New in releases later than 0.4.0:
 # c_string(number) returns an empty string of size number
 self.failUnless(len(c_string(32).raw) == 32)
@@ -181,7 +181,7 @@
 # One char too long values:
 self.assertRaises(ValueError, setattr, cs, "value", u"1234567")
 
- 
+
 def run_test(rep, msg, func, arg):
 items = range(rep)
 from time import clock
Modified: python/trunk/Lib/ctypes/test/test_structures.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_structures.py	(original)
+++ python/trunk/Lib/ctypes/test/test_structures.py	Thu Mar 9 02:15:05 2006
@@ -56,7 +56,7 @@
 "f": c_float,
 "d": c_double,
 }
- 
+
 def test_simple_structs(self):
 for code, tp in self.formats.items():
 class X(Structure):
@@ -90,7 +90,7 @@
 ("b", Y)]
 self.failUnlessEqual(alignment(SI), max(alignment(Y), alignment(X)))
 self.failUnlessEqual(sizeof(SI), calcsize("3s0i 3si 0i"))
- 
+
 class IS(Structure):
 _fields_ = [("b", Y),
 ("a", X)]
@@ -215,7 +215,7 @@
 # too long
 self.assertRaises(ValueError, Person, "1234567", 5)
 
- 
+
 def test_keyword_initializers(self):
 class POINT(Structure):
 _fields_ = [("x", c_int), ("y", c_int)]
@@ -315,7 +315,7 @@
 func(*args)
 except Exception, detail:
 return detail.__class__, str(detail)
- 
+
 
 ## def test_subclass_creation(self):
 ## meta = type(Structure)
@@ -373,4 +373,3 @@
 
 if __name__ == '__main__':
 unittest.main()
-
Modified: python/trunk/Lib/ctypes/test/test_win32.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_win32.py	(original)
+++ python/trunk/Lib/ctypes/test/test_win32.py	Thu Mar 9 02:15:05 2006
@@ -43,22 +43,22 @@
 
 class Structures(unittest.TestCase):
 
- def test_struct_by_value(self):
- class POINT(Structure):
- _fields_ = [("x", c_long),
- ("y", c_long)]
-
- class RECT(Structure):
- _fields_ = [("left", c_long),
- ("top", c_long),
- ("right", c_long),
- ("bottom", c_long)]
-
- dll = cdll.load(_ctypes_test.__file__)
-
- pt = POINT(10, 10)
- rect = RECT(0, 0, 20, 20)
- self.failUnlessEqual(1, dll.PointInRect(byref(rect), pt))
+ def test_struct_by_value(self):
+ class POINT(Structure):
+ _fields_ = [("x", c_long),
+ ("y", c_long)]
+
+ class RECT(Structure):
+ _fields_ = [("left", c_long),
+ ("top", c_long),
+ ("right", c_long),
+ ("bottom", c_long)]
+
+ dll = cdll.load(_ctypes_test.__file__)
+
+ pt = POINT(10, 10)
+ rect = RECT(0, 0, 20, 20)
+ self.failUnlessEqual(1, dll.PointInRect(byref(rect), pt))
 
 if __name__ == '__main__':
 unittest.main()
Modified: python/trunk/Lib/distutils/command/bdist_msi.py
==============================================================================
--- python/trunk/Lib/distutils/command/bdist_msi.py	(original)
+++ python/trunk/Lib/distutils/command/bdist_msi.py	Thu Mar 9 02:15:05 2006
@@ -216,10 +216,10 @@
 # Prefix ProductName with Python x.y, so that
 # it sorts together with the other Python packages
 # in Add-Remove-Programs (APR)
- product_name = "Python %s %s" % (self.target_version, 
+ product_name = "Python %s %s" % (self.target_version,
 self.distribution.get_fullname())
 self.db = msilib.init_database(installer_name, schema,
- product_name, msilib.gen_uuid(), 
+ product_name, msilib.gen_uuid(),
 sversion, author)
 msilib.add_tables(self.db, sequence)
 props = [('DistVersion', version)]
@@ -238,7 +238,7 @@
 self.db.Commit()
 
 if hasattr(self.distribution, 'dist_files'):
- self.distribution.dist_files.append(('bdist_msi', self.target_version, fullname))
+ self.distribution.dist_files.append(('bdist_msi', self.target_version, fullname))
 
 if not self.keep_temp:
 remove_tree(self.bdist_dir, dry_run=self.dry_run)
@@ -265,14 +265,14 @@
 if self.install_script_key:
 raise DistutilsOptionError, "Multiple files with name %s" % file
 self.install_script_key = '[#%s]' % key
- 
+
 cab.commit(db)
 
 def add_find_python(self):
 """Adds code to the installer to compute the location of Python.
 Properties PYTHON.MACHINE, PYTHON.USER, PYTHONDIR and PYTHON will be set
 in both the execute and UI sequences; PYTHONDIR will be set from
- PYTHON.USER if defined, else from PYTHON.MACHINE. 
+ PYTHON.USER if defined, else from PYTHON.MACHINE.
 PYTHON is PYTHONDIR\python.exe"""
 install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % self.target_version
 add_data(self.db, "RegLocator",
@@ -497,7 +497,7 @@
 seldlg.title("Select Destination Directory")
 
 version = sys.version[:3]+" "
- seldlg.text("Hint", 15, 30, 300, 40, 3, 
+ seldlg.text("Hint", 15, 30, 300, 40, 3,
 "The destination directory should contain a Python %sinstallation" % version)
 
 seldlg.back("< Back", None, active=0)
Modified: python/trunk/Lib/test/test_importhooks.py
==============================================================================
--- python/trunk/Lib/test/test_importhooks.py	(original)
+++ python/trunk/Lib/test/test_importhooks.py	Thu Mar 9 02:15:05 2006
@@ -252,7 +252,7 @@
 for mname in mnames:
 m = __import__(mname, globals(), locals(), ["__dummy__"])
 m.__loader__ # to make sure we actually handled the import
- # Delete urllib from modules because urlparse was imported above. 
+ # Delete urllib from modules because urlparse was imported above.
 # Without this hack, test_socket_ssl fails if run in this order:
 # regrtest.py test_codecmaps_tw test_importhooks test_socket_ssl
 try:


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /