Author: Matti Picus <[email protected]>
Branch: win32-cleanup2
Changeset: r54943:80607c82736d
Date: 2012-05-07 20:56 +0300
http://bitbucket.org/pypy/pypy/changeset/80607c82736d/

Log:    cleanup

diff --git a/pypy/module/rctime/test/test_rctime.py 
b/pypy/module/rctime/test/test_rctime.py
--- a/pypy/module/rctime/test/test_rctime.py
+++ b/pypy/module/rctime/test/test_rctime.py
@@ -231,7 +231,7 @@
         # Guard against invalid/non-supported format string
         # so that Python don't crash (Windows crashes when the format string
         # input to [w]strftime is not kosher.
-        if os.name =='nt':
+        if os.name == 'nt':
             raises(ValueError, rctime.strftime, '%f')
         else:
             assert rctime.strftime('%f') == '%f'
diff --git a/pypy/module/signal/interp_signal.py 
b/pypy/module/signal/interp_signal.py
--- a/pypy/module/signal/interp_signal.py
+++ b/pypy/module/signal/interp_signal.py
@@ -245,7 +245,7 @@
 
 def check_signum(space, signum):
     for sig in signal_values:
-        if signum ==sig:
+        if signum == sig:
             return
     raise OperationError(space.w_ValueError,
                          space.wrap("invalid signal value"))
diff --git a/pypy/rlib/test/test_rwin32.py b/pypy/rlib/test/test_rwin32.py
--- a/pypy/rlib/test/test_rwin32.py
+++ b/pypy/rlib/test/test_rwin32.py
@@ -1,28 +1,28 @@
-import os
-if os.name != 'nt':
-    skip('tests for win32 only')
-
-from pypy.rlib import rwin32
-from pypy.tool.udir import udir
-
-
-def test_get_osfhandle():
-    fid = open(str(udir.join('validate_test.txt')), 'w')
-    fd = fid.fileno()
-    rwin32.get_osfhandle(fd)
-    fid.close()
-    raises(OSError, rwin32.get_osfhandle, fd)
-    rwin32.get_osfhandle(0)
-
-def test_get_osfhandle_raising():
-    #try to test what kind of exception get_osfhandle raises w/out fd 
validation
-    skip('Crashes python')
-    fid = open(str(udir.join('validate_test.txt')), 'w')
-    fd = fid.fileno()
-    fid.close()
-    def validate_fd(fd):
-        return 1
-    _validate_fd = rwin32.validate_fd
-    rwin32.validate_fd = validate_fd
-    raises(WindowsError, rwin32.get_osfhandle, fd)
-    rwin32.validate_fd = _validate_fd
+import os
+if os.name != 'nt':
+    skip('tests for win32 only')
+
+from pypy.rlib import rwin32
+from pypy.tool.udir import udir
+
+
+def test_get_osfhandle():
+    fid = open(str(udir.join('validate_test.txt')), 'w')
+    fd = fid.fileno()
+    rwin32.get_osfhandle(fd)
+    fid.close()
+    raises(OSError, rwin32.get_osfhandle, fd)
+    rwin32.get_osfhandle(0)
+
+def test_get_osfhandle_raising():
+    #try to test what kind of exception get_osfhandle raises w/out fd 
validation
+    skip('Crashes python')
+    fid = open(str(udir.join('validate_test.txt')), 'w')
+    fd = fid.fileno()
+    fid.close()
+    def validate_fd(fd):
+        return 1
+    _validate_fd = rwin32.validate_fd
+    rwin32.validate_fd = validate_fd
+    raises(WindowsError, rwin32.get_osfhandle, fd)
+    rwin32.validate_fd = _validate_fd
diff --git a/pypy/rpython/llinterp.py b/pypy/rpython/llinterp.py
--- a/pypy/rpython/llinterp.py
+++ b/pypy/rpython/llinterp.py
@@ -152,7 +152,8 @@
             etype = frame.op_direct_call(exdata.fn_type_of_exc_inst, evalue)
             if etype == klass:
                 return cls
-        raise ValueError, "couldn't match exception, maybe it has RPython 
attributes like OSError?"
+        raise ValueError("couldn't match exception, maybe it"
+                      " has RPython attributes like OSError?")
 
     def get_transformed_exc_data(self, graph):
         if hasattr(graph, 'exceptiontransformed'):
diff --git a/pypy/rpython/test/test_llinterp.py 
b/pypy/rpython/test/test_llinterp.py
--- a/pypy/rpython/test/test_llinterp.py
+++ b/pypy/rpython/test/test_llinterp.py
@@ -34,7 +34,7 @@
     #start = time.time()
     res = call(*args, **kwds) 
     #elapsed = time.time() - start 
-    #print "%.2f secs" %(elapsed,)
+    #print "%.2f secs" % (elapsed,)
     return res 
 
 def gengraph(func, argtypes=[], viewbefore='auto', policy=None,
@@ -138,8 +138,8 @@
     try:
         got = interp.find_exception(info.value)
     except ValueError as message:
-        got = 'None %r'%message
-    assert got is exc, "wrong exception type, expected %r got %r"%(exc, got)
+        got = 'None %r' % message
+    assert got is exc, "wrong exception type, expected %r got %r" % (exc, got)
 
 #__________________________________________________________________
 # tests
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to