michaelb / sniprun

A neovim plugin to run lines/blocs of code (independently of the rest of the file), supporting multiples languages
MIT License
1.43k stars 46 forks source link

Python import list depend will got a error when run script #283

Closed HATTER-LONG closed 4 months ago

HATTER-LONG commented 4 months ago

import like this then run python script with sniprun will get error

from PySide6.QtWidgets import (
    QApplication,
    QMainWindow,
    QStackedLayout,
    QWidget,
)

image

the run code generated by sniprun of ~/Library/Caches/sniprun/python3_original/main.py:

try:

    import sys
    from PySide6.QtGui import QColor, QPalette
    from PySide6.QtWidgets import (

except:
    pass
michaelb commented 4 months ago

Indeed, I probably missed this way of doing python imports

Will fix (someday, hopefully not too far in the future)

michaelb commented 4 months ago

This issue should be fixed by the latest (v1.3.13) release. Don't hesitate to reopen this issue if you still experience problems related to the described bug