[pypy-commit] pypy exc-later: fix annotation for os.stat(fname)[i]

rlamy noreply at buildbot.pypy.org
Wed Mar 18 20:09:47 CET 2015


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: exc-later
Changeset: r76461:d21442bffbcf
Date: 2015-03-18 19:10 +0000
http://bitbucket.org/pypy/pypy/changeset/d21442bffbcf/

Log:	fix annotation for os.stat(fname)[i]

diff --git a/rpython/rtyper/module/ll_os_stat.py b/rpython/rtyper/module/ll_os_stat.py
--- a/rpython/rtyper/module/ll_os_stat.py
+++ b/rpython/rtyper/module/ll_os_stat.py
@@ -131,6 +131,7 @@
         assert 0 <= index < N_INDEXABLE_FIELDS, "os.stat()[index] out of range"
         name, TYPE = STAT_FIELDS[index]
         return lltype_to_annotation(TYPE)
+    getitem.can_only_throw = []
 
 
 class __extend__(pairtype(SomeStatvfsResult, annmodel.SomeInteger)):
@@ -138,6 +139,7 @@
         assert s_int.is_constant()
         name, TYPE = STATVFS_FIELDS[s_int.const]
         return lltype_to_annotation(TYPE)
+    getitem.can_only_throw = []
 
 
 s_StatResult = SomeStatResult()


More information about the pypy-commit mailing list