[py-svn] r8310 - in py/dist/py: execnet/testing path path/testing

hpk at codespeak.net hpk at codespeak.net
Sun Jan 16 17:35:39 CET 2005


Author: hpk
Date: Sun Jan 16 17:35:39 2005
New Revision: 8310

Modified:
   py/dist/py/execnet/testing/sshtesting.py
   py/dist/py/path/common.py
   py/dist/py/path/testing/fscommon.py
Log:
various windows related fixes/hacks (some of which
i don't fully understand yet) 



Modified: py/dist/py/execnet/testing/sshtesting.py
==============================================================================
--- py/dist/py/execnet/testing/sshtesting.py	(original)
+++ py/dist/py/execnet/testing/sshtesting.py	Sun Jan 16 17:35:39 2005
@@ -6,10 +6,10 @@
 
 #REMOTE_HOST = 'codespeak.net'
 #REMOTE_HOSTNAME = 'thoth.codespeak.net'
-REMOTE_HOST = 'localhost'    # you need to have a local ssh-daemon running!
-REMOTE_HOSTNAME = py.std.socket.gethostname() # the remote's socket.gethostname()
 
 def test_sshgateway():
+    REMOTE_HOST = 'localhost'    # you need to have a local ssh-daemon running!
+    REMOTE_HOSTNAME = py.std.socket.gethostname() # the remote's socket.gethostname()
     gw = py.execnet.SshGateway(REMOTE_HOST)
     c = gw.remote_exec('import socket; channel.send(socket.gethostname())')
     msg = c.receive()

Modified: py/dist/py/path/common.py
==============================================================================
--- py/dist/py/path/common.py	(original)
+++ py/dist/py/path/common.py	Sun Jan 16 17:35:39 2005
@@ -3,7 +3,7 @@
 
 """
 from __future__ import generators
-import sys
+import os, sys
 import py
 
 def checktype(pathinstance, kw):
@@ -189,6 +189,7 @@
 
     def _callex(self, func, *args):
         """ call a function and raise errno-exception if applicable. """
+        #__tracebackhide__ = True
         try:
             return func(*args)
         except (py.error.Error, KeyboardInterrupt, SystemExit):
@@ -196,10 +197,21 @@
         except EnvironmentError, e:
             if not hasattr(e, 'errno'):
                 raise
+            #__tracebackhide__ = False
             cls, value, tb = sys.exc_info()
-            cls = py.error._geterrnoclass(e.errno)
+            errno = e.errno 
+            try: 
+                if isinstance(e, WindowsError): 
+                    if errno == 3: 
+                        errno = 2  # XXX HACK 
+                    else: 
+                        raise cls, value, tb
+            except NameError: 
+                pass 
+            cls = py.error._geterrnoclass(errno)
             value = cls("%s%r" % (func.__name__, args))
-            raise cls, value, tb
+            #__tracebackhide__ = True
+            raise cls, value
 
 class fnmatch:
     def __init__(self, pattern):

Modified: py/dist/py/path/testing/fscommon.py
==============================================================================
--- py/dist/py/path/testing/fscommon.py	(original)
+++ py/dist/py/path/testing/fscommon.py	Sun Jan 16 17:35:39 2005
@@ -59,7 +59,7 @@
         newpath = self.root.join('samplefile.py')
         dirname, purebasename, basename, ext = newpath.get(
             'dirname,purebasename,basename,ext')
-        assert dirname == str(self.root)
+        assert str(self.root).endswith(dirname) # be careful with win32 'drive' 
         assert purebasename == 'samplefile'
         assert basename == 'samplefile.py'
         assert ext == '.py'



More information about the pytest-commit mailing list