← Back to team overview

sikuli-driver team mailing list archive

[Bug 1190167] Re: Jython: subclassing Region, overwriting Region methods and using super(): crashes with stack overflow caused by inheritance loop --- workaround

 

** Tags added: jython

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1190167

Title:
  Jython: subclassing Region, overwriting Region methods and using
  super(): crashes with stack overflow caused by inheritance loop ---
  workaround

Status in Sikuli:
  Confirmed

Bug description:
  *** workaround: see comment #1

  ---------------------------------------------------

  I'm trying to make a subclass of Region. Here's the relevant code:

  class MyRegion(Region):
      def __init__(self, region, regionName = "noNameDefined"):
          super(MyRegion, self).__init__(region)
          self.name = regionName

  (...)

      def find(self, ps):
          popup("about to find something")
          return super(MyRegion, self).find(ps)
          popup("found something")
      def dupeFind(self, ps):
          popup("about to find something in dupe")
          return super(MyRegion, self).find(ps)
          popup("found something in dupe")

  When I call my dupeFind method, I expect it to pass the call on to the
  superclass and return a match. What happens instead is that execution
  goes to the find method above it, which then calls itself indefinitely
  until I get a "RuntimeError ( maximum recursion depth exceeded )"
  since the recursion has busted the stack.

  What's going wrong?

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1190167/+subscriptions


References