Author Topic: refactor_quick_rename fails in python  (Read 659 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1901
  • Hero Points: 184
  • Text
refactor_quick_rename fails in python
« on: October 01, 2019, 09:06:23 pm »
In python, given this bit of code
Code: [Select]
def main(args):
    with open("logfile.txt", 'a', newline='') as log_file:
        print("LOG ", args, file=log_file)

Attempting to rename "log_file" fails with
---------------------------
SlickEdit Pro
---------------------------
Definition of 'log_file' not found.
---------------------------
OK   
---------------------------

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2920
  • Hero Points: 438
Re: refactor_quick_rename fails in python
« Reply #1 on: October 01, 2019, 11:54:48 pm »
Not a quick-refactoring bug per-se.  The problem is that "log_file" is not recognized as a local variable.

I'll file a bug for someone to look into fixing that in the Python parser.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5146
  • Hero Points: 425
Re: refactor_quick_rename fails in python
« Reply #2 on: October 04, 2019, 12:17:18 am »
Download v24.0.0.8. This is fixed in v24.0.0.8