|
1 | 1 | import collections
|
2 | 2 | import os
|
3 | 3 | import pdb
|
4 | | -try: |
5 | | - import pdbp # (Pdb+) --- Python Debugger Plus |
6 | | -except Exception: |
7 | | - pass |
8 | 4 | import sys
|
| 5 | +from contextlib import suppress |
9 | 6 | from selenium import webdriver
|
10 | 7 | from seleniumbase.__version__ import __version__
|
11 | 8 | from seleniumbase.common import decorators # noqa
|
12 | 9 | from seleniumbase.common import encryption # noqa
|
13 | | -from seleniumbase.core import colored_traceback# noqa |
| 10 | +from seleniumbase.core import colored_traceback |
14 | 11 | from seleniumbase.core.browser_launcher import get_driver # noqa
|
15 | 12 | from seleniumbase.fixtures import js_utils # noqa
|
16 | 13 | from seleniumbase.fixtures import page_actions # noqa
|
17 | 14 | from seleniumbase.fixtures import page_utils # noqa
|
18 | | -from seleniumbase.fixtures import shared_utils# noqa |
| 15 | +from seleniumbase.fixtures import shared_utils |
19 | 16 | from seleniumbase.fixtures.base_case import BaseCase # noqa
|
20 | 17 | from seleniumbase.masterqa.master_qa import MasterQA # noqa
|
21 | 18 | from seleniumbase.plugins.sb_manager import SB # noqa
|
22 | 19 | from seleniumbase.plugins.driver_manager import Driver # noqa
|
23 | 20 | from seleniumbase.plugins.driver_manager import DriverContext # noqa
|
24 | 21 | from seleniumbase import translate # noqa
|
25 | 22 |
|
| 23 | +with suppress(Exception): |
| 24 | + import colorama |
| 25 | + import pdbp # (Pdb+) --- Python Debugger Plus |
| 26 | + |
| 27 | +is_windows = shared_utils.is_windows() |
| 28 | +with suppress(Exception): |
| 29 | + if is_windows and hasattr(colorama, "just_fix_windows_console"): |
| 30 | + colorama.just_fix_windows_console() |
| 31 | + elif not shared_utils.is_linux(): |
| 32 | + colorama.init(autoreset=True) |
| 33 | + |
26 | 34 | if sys.version_info[0] < 3 and "pdbp" in locals():
|
27 | 35 | # With Python3, "import pdbp" is all you need
|
28 | 36 | for key in pdbp.__dict__.keys():
|
|
0 commit comments