reloadware/reloadium

Debugger strips some docstrings

Closed this issue · 1 comments

Describe the bug*

The Reloadium debugger seems to remove docstring information from functions when it ends with a return statement.

To Reproduce

Steps to reproduce the behavior (done on a fresh project):

  1. Write a function or method with a docstring and that ends with a return statement
  2. Try to programmatically get the docstring (with help(func) or func.__doc__ or inspect.getdoc(func))
  3. Click Debug with Reloadium
  4. The doc will be None

Example program:

def func():
    """Does something cool"""
    return

assert func.__doc__ is not None

Expected behavior

The doc attribute on the function should have the function's docstring as usual. The example program should not throw an AssertionError, and behave as it does with normal debug/run.

Desktop or remote (please complete the following information):**

  • OS: Windows Education
  • OS version: 10
  • M1 chip: no
  • Reloadium package version: 1.1.0
  • PyCharm plugin version: 1.1.0
  • Editor: PyCharm
  • Python Version: 3.11.2
  • Python Architecture: 32bit, 64bit
  • Run mode: Debug (not Fast Debug)

Additional context

Both of these versions behave as expected:

def func():
    """Does something cool"""
    if True:
        return

def func():
    """Does something cool"""
    return
    pass

Fixed in Reloadium 1.1.1 and PyCharm plugin 1.1.1