GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow bpython/bpdb outside main thread · pp1992m/bpython@51d208e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bpython/curtsiesfrontend
    • repl.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/curtsiesfrontend/repl.py‎

Copy file name to clipboardExpand all lines: bpython/curtsiesfrontend/repl.py
+13-4Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,12 @@ def __enter__(self):
531531
sys.stdin = self.stdin
532532
self.orig_sigwinch_handler = signal.getsignal(signal.SIGWINCH)
533533
self.orig_sigtstp_handler = signal.getsignal(signal.SIGTSTP)
534-
signal.signal(signal.SIGWINCH, self.sigwinch_handler)
535-
signal.signal(signal.SIGTSTP, self.sigtstp_handler)
534+
535+
try:
536+
signal.signal(signal.SIGWINCH, self.sigwinch_handler)
537+
signal.signal(signal.SIGTSTP, self.sigtstp_handler)
538+
except ValueError:
539+
pass # Ignore "signal only works in main thread"
536540

537541
self.orig_meta_path = sys.meta_path
538542
if self.watcher:
@@ -545,8 +549,13 @@ def __exit__(self, *args):
545549
sys.stdin = self.orig_stdin
546550
sys.stdout = self.orig_stdout
547551
sys.stderr = self.orig_stderr
548-
signal.signal(signal.SIGWINCH, self.orig_sigwinch_handler)
549-
signal.signal(signal.SIGTSTP, self.orig_sigtstp_handler)
552+
553+
try:
554+
signal.signal(signal.SIGWINCH, self.orig_sigwinch_handler)
555+
signal.signal(signal.SIGTSTP, self.orig_sigtstp_handler)
556+
except ValueError:
557+
pass # Ignore "signal only works in main thread"
558+
550559
sys.meta_path = self.orig_meta_path
551560

552561
def sigwinch_handler(self, signum, frame):

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.