Skip to content

Commit

Permalink
Delay importing pydevd until needed
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
tonyroberts committed Jul 15, 2022
1 parent db36efd commit 9004753
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions pyxll_pycharm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
suspend = 0
"""
from pyxll import get_config
import pydevd_pycharm
import pkg_resources
import pydevd
import ctypes
import logging
import sys
Expand All @@ -34,6 +32,11 @@

def connect_to_pycharm(*args):
"""Connect to the remote PyCharm debugger."""
# Defer importing pydevd until it's actually needed as it will conflict with using
# other debuggers such as VS Code.
import pydevd_pycharm
import pydevd

# Get the settings from the config
port = 5000
suspend = False
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
description="Adds PyCharm debugging support to PyXLL.",
long_description=long_description,
long_description_content_type='text/markdown',
version="0.2.0",
version="0.2.1",
packages=find_packages(),
include_package_data=True,
package_data={
Expand Down

0 comments on commit 9004753

Please sign in to comment.