mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Workaround pycharm debugger issue when used.
Works around https://youtrack.jetbrains.com/issue/PY-53232/Debugger-doesnt-work-when-pyproj-is-imported whenever the pycharm debugger is detected.
This commit is contained in:
parent
321de8d4ec
commit
24a04fb8c6
@ -1,5 +1,6 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
|
import ntpath
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -339,11 +340,27 @@ def lint_weapon_data_for_aircraft(aircraft: AircraftType) -> None:
|
|||||||
logging.warning(f'{weapon.clsid} "{weapon.name}" has no weapon data')
|
logging.warning(f'{weapon.clsid} "{weapon.name}" has no weapon data')
|
||||||
|
|
||||||
|
|
||||||
|
def fix_pycharm_debugger_if_needed() -> None:
|
||||||
|
"""Applies workaround for a pycharm debugger bug.
|
||||||
|
|
||||||
|
https://youtrack.jetbrains.com/issue/PY-53232/Debugger-doesnt-work-when-pyproj-is-imported
|
||||||
|
"""
|
||||||
|
# sys.gettrace() will return something whenever *some* debugger is being used. The
|
||||||
|
# pdb module will be loaded if that debugger is the built-in python debugger.
|
||||||
|
if sys.gettrace() is not None and "pdb" not in sys.modules:
|
||||||
|
logging.debug(
|
||||||
|
"Applying workaround for https://youtrack.jetbrains.com/issue/PY-53232/Debugger-doesnt-work-when-pyproj-is-imported"
|
||||||
|
)
|
||||||
|
ntpath.sep = "\\"
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
logging_config.init_logging(VERSION)
|
logging_config.init_logging(VERSION)
|
||||||
|
|
||||||
logging.debug("Python version %s", sys.version)
|
logging.debug("Python version %s", sys.version)
|
||||||
|
|
||||||
|
fix_pycharm_debugger_if_needed()
|
||||||
|
|
||||||
if not str(Path(__file__)).isascii():
|
if not str(Path(__file__)).isascii():
|
||||||
logging.warning(
|
logging.warning(
|
||||||
"Installation path contains non-ASCII characters. This is known to cause problems."
|
"Installation path contains non-ASCII characters. This is known to cause problems."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user