File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed
Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 3232
3333
3434import sys
35- import threading
3635
3736py3 = sys .version_info [0 ] == 3
3837
@@ -53,15 +52,3 @@ def try_decode(s, encoding):
5352 except UnicodeDecodeError :
5453 return None
5554 return s
56-
57-
58- if py3 :
59-
60- def is_main_thread ():
61- return threading .main_thread () == threading .current_thread ()
62-
63-
64- else :
65-
66- def is_main_thread ():
67- return isinstance (threading .current_thread (), threading ._MainThread )
Original file line number Diff line number Diff line change 1414import signal
1515import greenlet
1616import logging
17+ import threading
1718
18- from bpython ._py3compat import py3 , is_main_thread
19+ from bpython ._py3compat import py3
1920from bpython .config import getpreferredencoding
2021
2122logger = logging .getLogger (__name__ )
2223
2324
25+ def is_main_thread ():
26+ return threading .main_thread () == threading .current_thread ()
27+
28+
2429class SigintHappened (object ):
2530 """If this class is returned, a SIGINT happened while the main greenlet"""
2631
Original file line number Diff line number Diff line change 3636from bpython .formatter import BPythonFormatter
3737from bpython import autocomplete
3838from bpython .translations import _
39- from bpython ._py3compat import py3 , is_main_thread
39+ from bpython ._py3compat import py3
4040from bpython .pager import get_pager_command
4141
4242from bpython .curtsiesfrontend import replpainter as paint
4343from bpython .curtsiesfrontend import sitefix
44- from bpython .curtsiesfrontend .coderunner import CodeRunner , FakeOutput
44+ from bpython .curtsiesfrontend .coderunner import CodeRunner , FakeOutput , is_main_thread
4545from bpython .curtsiesfrontend .filewatch import ModuleChangedEventHandler
4646from bpython .curtsiesfrontend .interaction import StatusBar
4747from bpython .curtsiesfrontend .manual_readline import edit_keys
You can’t perform that action at this time.
0 commit comments