1. raineszm
  2. rubypython

Commits

raineszm  committed 3dca5fc

Disabled callbacks for now in legacy mode.

  • Participants
  • Parent commits 89198e3
  • Branches default

Comments (0)

Files changed (2)

File lib/rubypython/conversion.rb

View file
       when nil
         rtopNone
       when Proc, Method
+        raise UnsupportedConversion.new("Python to Ruby callbacks not suppported in legacy mode") if RubyPython.legacy_mode
         rtopProc rObj
       else
         raise UnsupportedConversion.new("Unsupported type for RTOP conversion." )

File spec/legacy_spec.rb

View file
         @objects.__send__(py_type.sub(' ', '_')).should == output
       end
     end
+
+    [
+      ["proc", AProc],
+      ["method", AMethod]
+    ].each do |rb_type, rb_obj| 
+      it "should raise an exception if a #{rb_type} callback is supplied" do
+        lambda do
+          @objects.apply_callback(rb_obj, [1, 1])
+        end.should raise_exception(RubyPython::Conversion::UnsupportedConversion)
+      end
+    end
   end
 
 end