Author: Armin Rigo <ar...@tunes.org>
Branch: py3.6
Changeset: r98534:a443ea8e15fc
Date: 2020-01-14 15:29 +0100
http://bitbucket.org/pypy/pypy/changeset/a443ea8e15fc/

Log:    hg merge default

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,6 @@
 all: pypy-c cffi_imports
 
 PYPY_EXECUTABLE := $(shell which pypy)
-URAM := $(shell python -c "import sys; print 4.5 if sys.maxint>1<<32 else 2.5")
 
 ifeq ($(PYPY_EXECUTABLE),)
 RUNINTERP = python
@@ -10,6 +9,8 @@
 RUNINTERP = $(PYPY_EXECUTABLE)
 endif
 
+URAM := $(shell $(RUNINTERP) -c "import sys; print 4.5 if sys.maxint>1<<32 
else 2.5")
+
 .PHONY: pypy-c cffi_imports
 
 pypy-c:
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -263,6 +263,7 @@
             dict_w[name] = w_descr
             i += 1
 
+WARN_MISSING_SLOTS = False
 missing_slots={}
 def warn_missing_slot(space, method_name, slot_name, w_type):
     if not we_are_translated():
@@ -289,7 +290,8 @@
 
         if not slot_func_helper:
             if not slot_apifunc:
-                warn_missing_slot(space, method_name, slot_name, w_type)
+                if WARN_MISSING_SLOTS:
+                    warn_missing_slot(space, method_name, slot_name, w_type)
                 continue
             slot_func_helper = slot_apifunc.get_llhelper(space)
         fill_slot(space, pto, w_type, slot_names, slot_func_helper)
diff --git a/rpython/rtyper/debug.py b/rpython/rtyper/debug.py
--- a/rpython/rtyper/debug.py
+++ b/rpython/rtyper/debug.py
@@ -32,6 +32,12 @@
         return s_x.nonnoneify()
 
     def specialize_call(self, hop):
+        from rpython.annotator import model as annmodel
+        from rpython.rtyper.error import TyperError
+        if annmodel.s_None.contains(hop.args_s[0]):
+            raise TyperError("ll_assert_not_none(None) detected.  This might "
+                             "come from something that annotates as "
+                             "'raise None'.")
         [v0] = hop.inputargs(hop.args_r[0])
         hop.exception_cannot_occur()
         hop.genop('debug_assert_not_none', [v0])
diff --git a/rpython/rtyper/test/test_exception.py 
b/rpython/rtyper/test/test_exception.py
--- a/rpython/rtyper/test/test_exception.py
+++ b/rpython/rtyper/test/test_exception.py
@@ -3,7 +3,7 @@
 from rpython.translator.translator import TranslationContext
 from rpython.rtyper.test.tool import BaseRtypingTest
 from rpython.rtyper.llinterp import LLException
-from rpython.rtyper.error import MissingRTypeOperation
+from rpython.rtyper.error import MissingRTypeOperation, TyperError
 
 
 class MyException(Exception):
@@ -164,3 +164,10 @@
             except OverflowError:
                 return 42
         py.test.raises(MissingRTypeOperation, self.interpret, f, [])
+
+    def test_cannot_raise_something_annotated_as_none(self):
+        def g():
+            return None
+        def f():
+            raise g()
+        py.test.raises(TyperError, rtype, f)
diff --git a/rpython/translator/c/genc.py b/rpython/translator/c/genc.py
--- a/rpython/translator/c/genc.py
+++ b/rpython/translator/c/genc.py
@@ -218,6 +218,10 @@
             fn = py.path.local(fn)
             if not fn.relto(udir):
                 newname = self.targetdir.join(fn.basename)
+                if newname.check(exists=True):
+                    raise ValueError(
+                        "Cannot have two different separate_module_sources "
+                        "with the same basename, please rename one: %s" % 
fn.basename)
                 fn.copy(newname)
                 fn = newname
             extrafiles.append(fn)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to