Skip to content

verify_distribution: Stop setting TERMINFO_DIRS and TCL_LIBRARY #699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 1 addition & 32 deletions src/verify_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,6 @@
import sys
import unittest

TERMINFO_DIRS = [
"/etc/terminfo",
"/lib/terminfo",
"/usr/share/terminfo",
]

TCL_PATHS = [
# POSIX
("lib", "tcl", "tcl"),
# Windows.
("tcl",),
]

HERE = os.path.dirname(sys.executable)
INSTALL_ROOT = os.path.dirname(HERE)

# Need to set TCL_LIBRARY so local tcl/tk files get picked up.
for parts in TCL_PATHS:
candidate = os.path.join(INSTALL_ROOT, *parts)

if os.path.exists(candidate):
os.environ["TCL_LIBRARY"] = candidate
break

# Need to set TERMINFO_DIRS so terminfo database can be located.
if "TERMINFO_DIRS" not in os.environ:
terminfo_dirs = [p for p in TERMINFO_DIRS if os.path.exists(p)]
if terminfo_dirs:
os.environ["TERMINFO_DIRS"] = ":".join(terminfo_dirs)


class TestPythonInterpreter(unittest.TestCase):
def test_compression(self):
Expand Down Expand Up @@ -68,7 +38,7 @@ def error_handler(fif, message):
def test_curses_import(self):
import curses

assert curses is not None
self.assertIsNotNone(curses)

@unittest.skipIf(os.name == "nt", "curses not available on Windows")
@unittest.skipIf("TERM" not in os.environ, "TERM not set")
Expand Down Expand Up @@ -165,7 +135,6 @@ def test_gil_disabled(self):

self.assertEqual(sysconfig.get_config_var("Py_GIL_DISABLED"), wanted)

@unittest.skipIf("TCL_LIBRARY" not in os.environ, "TCL_LIBRARY not set")
@unittest.skipIf("DISPLAY" not in os.environ, "DISPLAY not set")
def test_tkinter(self):
import tkinter as tk
Expand Down