← Back to team overview

sikuli-driver team mailing list archive

[Bug 1810640] Re: [1.1.4] HotKey Events called even after exiting script with an exception

 

Apparently the cleanup, that is done at normal script termination, is not done in this case.
I will fix asap.

** Summary changed:

- HotKey Events called even after exit and error
+ [1.1.4] HotKey Events called even after exiting script with an exception

** Summary changed:

- [1.1.4] HotKey Events called even after exiting script with an exception
+ [1.1.4] IDE: HotKey Events called even after terminating script caused by an exception

** Changed in: sikuli
       Status: New => Fix Committed

** Changed in: sikuli
   Importance: Undecided => High

** Changed in: sikuli
     Assignee: (unassigned) => RaiMan (raimund-hocke)

** Changed in: sikuli
    Milestone: None => 1.1.4

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

Title:
  [1.1.4] IDE: HotKey Events called even after terminating script caused
  by an exception

Status in Sikuli:
  Fix Committed

Bug description:
  HotKey events are called efen if the script raises an error or exits.
  example:

  def F10(event):
      print "F10"
  def F11(event):
      print "F11"
  def F12(event):
      print "F12"
  def PGUP(event):
      print "PGUP"
     
      
  Env.addHotkey(Key.F10, KeyModifier.CTRL, F10)
  Env.addHotkey(Key.F11, KeyModifier.CTRL, F11)
  Env.addHotkey(Key.F12, KeyModifier.CTRL, F12)
  Env.addHotkey(Key.PAGE_UP, KeyModifier.CTRL, PGUP)

  a=1/0
  exit()

  Results:

  [error] script [ test ] stopped with error at line --unknown--
  [error] Error caused by: Traceback (most recent call last): File "C:\temp\SikuliX\test.sikuli\test.py", line 17, in <module> a=1/0 ZeroDivisionError: integer division or modulo by zero 

  F10

  F11

  F12

  PGUP

  
  You can see, the functions are called even after the division by zero.
  Fun Fact: In case i now change the function, for instance:

  change UP to DOWN: Env.addHotkey(Key.PAGE_DOWN, KeyModifier.CTRL, PGUP)
  actually I did not add it! Only alter the 4 characters.

  Both keys are now reacting, having only one of them in the code.
  Restart the IDE make the keys go away. (and of course unassignment - however that's not possible in case of errors)

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


References