[pypy-commit] pypy default: Removed some now unused code (was for ootypesystem)

alex_gaynor noreply at buildbot.pypy.org
Mon Aug 5 02:13:34 CEST 2013


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r65943:0193d7e63652
Date: 2013-08-04 17:12 -0700
http://bitbucket.org/pypy/pypy/changeset/0193d7e63652/

Log:	Removed some now unused code (was for ootypesystem)

diff --git a/rpython/rtyper/extfuncregistry.py b/rpython/rtyper/extfuncregistry.py
--- a/rpython/rtyper/extfuncregistry.py
+++ b/rpython/rtyper/extfuncregistry.py
@@ -61,27 +61,3 @@
                           sandboxsafe=True,
                           llimpl=getattr(ll_math, method_name))
 
-# ___________________________
-# os.path functions
-
-from rpython.tool.sourcetools import func_with_new_name
-import os.path
-
-# os.path.join is RPython, but we don't want to compile it directly
-# because it's platform dependant. This is ok for lltype where the
-# execution platform is the same as the translation platform, but not
-# for ootype where the executable produced by some backends (e.g. CLI,
-# JVM) are expected to run everywhere.  Thus, we register it as an
-# external function, but we provide a clone for lltype using
-# func_with_new_name.
-
-path_functions = [
-    ('join',     [ll_os.str0, ll_os.str0], ll_os.str0),
-    ('dirname',  [ll_os.str0], ll_os.str0),
-    ]
-
-for name, args, res in path_functions:
-    func = getattr(os.path, name)
-    llimpl = func_with_new_name(func, name)
-    register_external(func, args, res, 'll_os_path.ll_%s' % name,
-                      llimpl=llimpl, sandboxsafe=True)
diff --git a/rpython/rtyper/module/test/test_ll_os.py b/rpython/rtyper/module/test/test_ll_os.py
--- a/rpython/rtyper/module/test/test_ll_os.py
+++ b/rpython/rtyper/module/test/test_ll_os.py
@@ -50,7 +50,7 @@
     if not hasattr(os, 'statvfs'):
         py.test.skip('posix specific function')
     try:
-        expected = os.statvfs('.')
+        os.statvfs('.')
     except OSError, e:
         py.test.skip("the underlying os.statvfs() failed: %s" % e)
     getllimpl(os.statvfs)('.')
@@ -59,7 +59,7 @@
     if not hasattr(os, 'fstatvfs'):
         py.test.skip('posix specific function')
     try:
-        expected = os.fstatvfs(0)
+        os.fstatvfs(0)
     except OSError, e:
         py.test.skip("the underlying os.fstatvfs() failed: %s" % e)
     getllimpl(os.fstatvfs)(0)
@@ -87,7 +87,7 @@
     assert data == posix._getfullpathname(stuff)
     # the most intriguing failure of ntpath.py should not repeat, here:
     assert not data.endswith(stuff)
-    
+
 def test_getcwd():
     data = getllimpl(os.getcwd)()
     assert data == os.getcwd()
@@ -104,8 +104,8 @@
             # the ctypes call seems not to work in the Wing debugger
             return
         assert str(buf.value).lower() == pwd.lower()
-        # ctypes returns the drive letter in uppercase, 
-        # os.getcwd does not, 
+        # ctypes returns the drive letter in uppercase,
+        # os.getcwd does not,
         # but there may be uppercase in os.getcwd path
 
     pwd = os.getcwd()
@@ -298,11 +298,10 @@
     def setup_class(cls):
         if not hasattr(os, 'ttyname'):
             py.test.skip("no ttyname")
-    
+
     def test_ttyname(self):
         def f():
             import os
-            import py
             from rpython.rtyper.test.test_llinterp import interpret
 
             def ll_to_string(s):
diff --git a/rpython/rtyper/module/test/test_ll_os_path.py b/rpython/rtyper/module/test/test_ll_os_path.py
--- a/rpython/rtyper/module/test/test_ll_os_path.py
+++ b/rpython/rtyper/module/test/test_ll_os_path.py
@@ -3,10 +3,10 @@
 import sys, os
 
 from rpython.rtyper.lltypesystem.module.ll_os_path import Implementation as impl
-from rpython.rtyper.module.support import ll_strcpy
 from rpython.rtyper.test.test_llinterp import interpret
 from rpython.tool.udir import udir
 
+
 def test_exists():
     filename = impl.to_rstr(str(py.path.local(__file__)))
     assert impl.ll_os_path_exists(filename) == True


More information about the pypy-commit mailing list