[pypy-commit] pypy app_main-refactor: make sure that os.getcwd() returns a SomeString(no_nul=True)
antocuni
noreply at buildbot.pypy.org
Sat Jun 9 14:01:55 CEST 2012
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: app_main-refactor
Changeset: r55533:08cad43cd093
Date: 2012-06-09 12:14 +0200
http://bitbucket.org/pypy/pypy/changeset/08cad43cd093/
Log: make sure that os.getcwd() returns a SomeString(no_nul=True)
diff --git a/pypy/annotation/test/test_annrpython.py b/pypy/annotation/test/test_annrpython.py
--- a/pypy/annotation/test/test_annrpython.py
+++ b/pypy/annotation/test/test_annrpython.py
@@ -3780,6 +3780,16 @@
e = py.test.raises(Exception, a.build_types, f, [])
assert 'object with a __call__ is not RPython' in str(e.value)
+ def test_os_getcwd(self):
+ import os
+ def fn():
+ return os.getcwd()
+ a = self.RPythonAnnotator()
+ s = a.build_types(fn, [])
+ assert isinstance(s, annmodel.SomeString)
+ assert s.no_nul
+
+
def g(n):
return [0,1,2,n]
diff --git a/pypy/rpython/module/ll_os.py b/pypy/rpython/module/ll_os.py
--- a/pypy/rpython/module/ll_os.py
+++ b/pypy/rpython/module/ll_os.py
@@ -1114,7 +1114,7 @@
def os_getcwd_oofakeimpl():
return OOSupport.to_rstr(os.getcwd())
- return extdef([], str,
+ return extdef([], str0,
"ll_os.ll_os_getcwd", llimpl=os_getcwd_llimpl,
oofakeimpl=os_getcwd_oofakeimpl)
More information about the pypy-commit
mailing list