src/eric7/CodeFormatting/IsortUtilities.py

branch
eric7
changeset 9475
5c09d70e9290
parent 9453
e5065dde905d
child 9653
e67609152c5e
equal deleted inserted replaced
9474:7258d36204be 9475:5c09d70e9290
5 5
6 """ 6 """
7 Module implementing some utility functions for the isort import statement formatting 7 Module implementing some utility functions for the isort import statement formatting
8 tool. 8 tool.
9 """ 9 """
10
11 import contextlib
12 import os
13 import sys
14 10
15 import isort 11 import isort
16 12
17 from PyQt6.QtCore import QCoreApplication, pyqtSlot 13 from PyQt6.QtCore import QCoreApplication, pyqtSlot
18 14
33 """<p><i>isort</i> is a Python utility / library to sort imports""" 29 """<p><i>isort</i> is a Python utility / library to sort imports"""
34 """ alphabetically, and automatically separated into sections and by""" 30 """ alphabetically, and automatically separated into sections and by"""
35 """ type.</p>""", 31 """ type.</p>""",
36 ).format(isort.__version__), 32 ).format(isort.__version__),
37 ) 33 )
38
39
40 @contextlib.contextmanager
41 def suppressStderr():
42 """
43 Function to suppress output to stderr.
44 """
45 stderr = sys.stderr
46 with open(os.devnull, "w") as devnull:
47 sys.stderr = devnull
48 yield
49 sys.stderr = stderr

eric ide

mercurial