Author: fijal
Branch: 
Changeset: r92087:2c6fe9073d99
Date: 2017-08-05 10:12 +0200
http://bitbucket.org/pypy/pypy/changeset/2c6fe9073d99/

Log:    whack until things stop exploding. can't reproduce in a test

diff --git a/rpython/rlib/rpath.py b/rpython/rlib/rpath.py
--- a/rpython/rlib/rpath.py
+++ b/rpython/rlib/rpath.py
@@ -5,6 +5,7 @@
 import os, stat
 from rpython.rlib import rposix
 from rpython.rlib.signature import signature
+from rpython.rlib.rstring import assert_str0
 from rpython.annotator.model import s_Str0
 
 
@@ -31,9 +32,11 @@
     """Test whether a path is absolute"""
     return s.startswith('/')
 
+@signature(s_Str0, returns=s_Str0)
 def _posix_rnormpath(path):
     """Normalize path, eliminating double slashes, etc."""
     slash, dot = '/', '.'
+    assert_str0(dot)
     if path == '':
         return dot
     initial_slashes = path.startswith('/')
@@ -56,6 +59,7 @@
     path = slash.join(comps)
     if initial_slashes:
         path = slash*initial_slashes + path
+    assert_str0(path)
     return path or dot
 
 @signature(s_Str0, returns=s_Str0)
@@ -66,6 +70,7 @@
         if not _posix_risabs(path):
             cwd = os.getcwd()
             path = _posix_rjoin(cwd, path)
+        assert path is not None
         return _posix_rnormpath(path)
     except OSError:
         return path
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to