Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit11d63cc

Browse files
committed
Require urwid >= 1.0
1 parentb6494ff commit11d63cc

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

‎bpython/urwid.py‎

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -95,39 +95,7 @@ def buildProtocol(self, addr):
9595
# If Twisted is not available urwid has no TwistedEventLoop attribute.
9696
# Code below will try to import reactor before using TwistedEventLoop.
9797
# I assume TwistedEventLoop will be available if that import succeeds.
98-
ifurwid.VERSION< (1,0,0)andhasattr(urwid,"TwistedEventLoop"):
99-
100-
classTwistedEventLoop(urwid.TwistedEventLoop):
101-
"""TwistedEventLoop modified to properly stop the reactor.
102-
103-
urwid 0.9.9 and 0.9.9.1 crash the reactor on ExitMainLoop instead
104-
of stopping it. One obvious way this breaks is if anything used
105-
the reactor's thread pool: that thread pool is not shut down if
106-
the reactor is not stopped, which means python hangs on exit
107-
(joining the non-daemon threadpool threads that never exit). And
108-
the default resolver is the ThreadedResolver, so if we looked up
109-
any names we hang on exit. That is bad enough that we hack up
110-
urwid a bit here to exit properly.
111-
"""
112-
113-
defhandle_exit(self,f):
114-
defwrapper(*args,**kwargs):
115-
try:
116-
returnf(*args,**kwargs)
117-
excepturwid.ExitMainLoop:
118-
# This is our change.
119-
self.reactor.stop()
120-
except:
121-
# This is the same as in urwid.
122-
# We are obviously not supposed to ever hit this.
123-
print(sys.exc_info())
124-
self._exc_info=sys.exc_info()
125-
self.reactor.crash()
126-
127-
returnwrapper
128-
129-
else:
130-
TwistedEventLoop=getattr(urwid,"TwistedEventLoop",None)
98+
TwistedEventLoop=getattr(urwid,"TwistedEventLoop",None)
13199

132100

133101
classStatusbarEdit(urwid.Edit):

‎setup.cfg‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ install_requires =
3535
[options.extras_require]
3636
clipboard = pyperclip
3737
jedi = jedi >= 0.16
38-
urwid = urwid < 3.0
38+
urwid = urwid>=1.0,< 3.0
3939
watch = watchdog
4040

4141
[options.entry_points]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp