Commits

Brian Kearns committed 2529b6f Merge

merge default

Comments (0)

Files changed (3)

pypy/module/test_lib_pypy/numpypy/test_numpy.py

                numpypy.core.multiarray.set_string_function
 
     def test_constants(self):
+        import math
         import numpypy
         assert numpypy.PZERO == numpypy.NZERO == 0.0
-        assert numpypy.inf is float('inf')
-        assert numpypy.nan is float('nan')
+        assert math.isinf(numpypy.inf)
+        assert math.isnan(numpypy.nan)

rpython/jit/metainterp/pyjitpl.py

             self.make_result_of_lastop(resbox)
             # ^^^ this is done before handle_possible_exception() because we
             # need the box to show up in get_list_of_active_boxes()
-        if pure and self.metainterp.last_exc_value_box is None:
+        if pure and self.metainterp.last_exc_value_box is None and resbox:
             resbox = self.metainterp.record_result_of_call_pure(resbox)
             exc = exc and not isinstance(resbox, Const)
         if exc:

rpython/jit/metainterp/test/test_call.py

         res = self.interp_operations(f, [3])
         assert res == f(3)
     
+    def test_call_elidable_none(self):
+        d = {}
+        
+        @jit.elidable
+        def f(a):
+            return d.get(a, None)
+
+        driver = jit.JitDriver(greens = [], reds = ['n'])
+
+        def main(n):
+            while n > 0:
+                driver.jit_merge_point(n=n)
+                f(n)
+                f(n)
+                n -= 1
+            return 3
+
+        self.meta_interp(main, [10])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.