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 — Handle changed output in Python 3.11 · apporc/bpython@7420856

File tree

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

‎bpython/test/test_interpreter.py‎

Copy file name to clipboardExpand all lines: bpython/test/test_interpreter.py
+29-13Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,35 @@ def gfunc():
112112

113113
global_not_found = "name 'gfunc' is not defined"
114114

115-
expected = (
116-
"Traceback (most recent call last):\n File "
117-
+ green('"<input>"')
118-
+ ", line "
119-
+ bold(magenta("1"))
120-
+ ", in "
121-
+ cyan("<module>")
122-
+ "\n gfunc()\n"
123-
+ bold(red("NameError"))
124-
+ ": "
125-
+ cyan(global_not_found)
126-
+ "\n"
127-
)
115+
if (3, 11) <= sys.version_info[:2]:
116+
expected = (
117+
"Traceback (most recent call last):\n File "
118+
+ green('"<input>"')
119+
+ ", line "
120+
+ bold(magenta("1"))
121+
+ ", in "
122+
+ cyan("<module>")
123+
+ "\n gfunc()"
124+
+ "\n ^^^^^\n"
125+
+ bold(red("NameError"))
126+
+ ": "
127+
+ cyan(global_not_found)
128+
+ "\n"
129+
)
130+
else:
131+
expected = (
132+
"Traceback (most recent call last):\n File "
133+
+ green('"<input>"')
134+
+ ", line "
135+
+ bold(magenta("1"))
136+
+ ", in "
137+
+ cyan("<module>")
138+
+ "\n gfunc()\n"
139+
+ bold(red("NameError"))
140+
+ ": "
141+
+ cyan(global_not_found)
142+
+ "\n"
143+
)
128144

129145
self.assertMultiLineEqual(str(plain("").join(a)), str(expected))
130146
self.assertEqual(plain("").join(a), expected)

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.