Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move refactor function between modules fails when there is a decorator #419

Closed
lieryan opened this issue Sep 26, 2021 · 0 comments · Fixed by #472
Closed

Move refactor function between modules fails when there is a decorator #419

lieryan opened this issue Sep 26, 2021 · 0 comments · Fixed by #472
Labels
affected-version:0.20 bug Unexpected or incorrect user-visible behavior
Milestone

Comments

@lieryan
Copy link
Member

lieryan commented Sep 26, 2021

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Code before refactoring:
# mod1.py
def hello(func):
    return func
@hello
def foo():
    pass
# mod2.py
print("test")
  1. Move refactor mod1.foo() to mod2

  2. Expected code after refactoring:

# mod1.py
def hello(func):
    return func
# mod2.py
from func import hello

@hello
def foo():
    pass

print("test")
  1. Describe the error or unexpected result that you are getting
Syntax error in file <mod1.py> line <4>: invalid syntax

Editor information (please complete the following information):

  • Rope Python version: Python 3.8
  • Rope version: 0.20.1
@lieryan lieryan added bug Unexpected or incorrect user-visible behavior affected-version:0.20 labels Sep 26, 2021
@lieryan lieryan changed the title Moving function between modules with decorators fails Move refactor function between modules fails when there is a decorator Sep 26, 2021
@lieryan lieryan added this to the 0.22.x milestone Sep 29, 2021
@lieryan lieryan modified the milestones: 0.22.x, 0.23.0 Nov 22, 2021
@lieryan lieryan modified the milestones: 0.23.0, 0.24.0 Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected-version:0.20 bug Unexpected or incorrect user-visible behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant