From 63e934c2a807f5a6babca50bfb487654a194392e Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Sun, 7 Jan 2024 23:06:51 +0100 Subject: [PATCH] remove dependency on 'six' transitional library --- .pylintrc | 2 +- setup.py | 2 +- sphinxcontrib/autoprogram.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pylintrc b/.pylintrc index b9fd037..f022365 100644 --- a/.pylintrc +++ b/.pylintrc @@ -52,4 +52,4 @@ variable-naming-style=snake_case [VARIABLES] -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file +redefining-builtins-modules=builtins,io diff --git a/setup.py b/setup.py index 1bee920..9679ba5 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ # Do not change the variable name. It's parsed by doc/conf.py script. version = '0.1.8' -requires = ['Sphinx >= 1.2', 'six'] +requires = ['Sphinx >= 1.2'] def readme(): diff --git a/sphinxcontrib/autoprogram.py b/sphinxcontrib/autoprogram.py index 635ea82..ef479e7 100644 --- a/sphinxcontrib/autoprogram.py +++ b/sphinxcontrib/autoprogram.py @@ -12,11 +12,13 @@ # pylint: disable=protected-access,missing-docstring import argparse +import builtins import collections import inspect import os import re import sys +from functools import reduce from typing import Any, Dict, Iterable, List, Optional, Tuple import unittest from unittest import mock @@ -25,8 +27,6 @@ from docutils.parsers.rst import Directive from docutils.parsers.rst.directives import unchanged from docutils.statemachine import StringList, ViewList -from six import exec_ -from six.moves import builtins, reduce from sphinx.domains import std from sphinx.util.nodes import nested_parse_with_titles @@ -154,7 +154,7 @@ def import_object(import_name: str): with open(f[0]) as fobj: codestring = fobj.read() foo = imp.new_module("foo") - exec_(codestring, foo.__dict__) + exec(codestring, foo.__dict__) sys.modules["foo"] = foo mod = __import__("foo")