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 — Fix older py3 version edge case. · grisha/mod_python@5c469d6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/python/mod_python
    • cgihandler.py
    • publisher.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/python/mod_python/cgihandler.py‎

Copy file name to clipboardExpand all lines: lib/python/mod_python/cgihandler.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import sys
2323
PY2 = sys.version[0] == '2'
2424

25-
if PY2:
25+
if PY2 or sys.hexversion < 0x03120000:
2626
import imp
2727
else:
2828
import importlib.util
@@ -102,7 +102,7 @@ def handler(req):
102102
if not scriptPath.startswith(dir):
103103
raise apache.SERVER_RETURN(apache.HTTP_NOT_FOUND)
104104

105-
if PY2:
105+
if PY2 or sys.hexversion < 0x03120000:
106106

107107
try:
108108
# we do not search the pythonpath (security reasons)
Collapse file

‎lib/python/mod_python/publisher.py‎

Copy file name to clipboardExpand all lines: lib/python/mod_python/publisher.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,11 @@ def lookup(name):
255255
if name in names:
256256
i = list(names).index(name)
257257
if i is not None:
258-
return (1, func_code.co_consts[i+1])
258+
if PY2 or sys.hexversion >= 0x03120000:
259+
return (1, func_code.co_consts[i+1])
260+
else:
261+
return (1, func_code.co_consts[1+i*2])
262+
259263
return (0, None)
260264

261265
(found_auth, __auth__) = lookup('__auth__')

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.