summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2020-10-19 15:50:36 +0100
committerGitHub <noreply@github.com>2020-10-19 15:50:36 +0100
commitc82f10450c547eb94a04ee17b7c816ff31948297 (patch)
treead305c05c5745e1a5e7c136545bec7eefa741e32 /Tools
parenteee6bb50c69d94280f43b47390ea9d1b5f42930c (diff)
parentb580ed1d9d55461d8dde027411b90be26cae131e (diff)
downloadcpython-git-bpo-39107.tar.gz
Merge branch 'master' into bpo-39107bpo-39107
Diffstat (limited to 'Tools')
-rw-r--r--Tools/c-analyzer/c_analyzer/common/files.py4
-rwxr-xr-xTools/clinic/clinic.py13
-rw-r--r--Tools/peg_generator/pegen/sccutils.py4
3 files changed, 18 insertions, 3 deletions
diff --git a/Tools/c-analyzer/c_analyzer/common/files.py b/Tools/c-analyzer/c_analyzer/common/files.py
index f630afe625..a8a044757d 100644
--- a/Tools/c-analyzer/c_analyzer/common/files.py
+++ b/Tools/c-analyzer/c_analyzer/common/files.py
@@ -60,7 +60,7 @@ def glob_tree(root, *,
def iter_files(root, suffix=None, relparent=None, *,
- get_files=os.walk,
+ get_files=None,
_glob=glob_tree,
_walk=walk_tree,
):
@@ -75,6 +75,8 @@ def iter_files(root, suffix=None, relparent=None, *,
if "relparent" is provided then it is used to resolve each
filename as a relative path.
"""
+ if get_files is None:
+ get_files = os.walk
if not isinstance(root, str):
roots = root
for root in roots:
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 1bbbd4f9fb..5f2eb53e6a 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -3103,6 +3103,19 @@ class size_t_converter(CConverter):
return super().parse_arg(argname, displayname)
+class fildes_converter(CConverter):
+ type = 'int'
+ converter = '_PyLong_FileDescriptor_Converter'
+
+ def _parse_arg(self, argname, displayname):
+ return """
+ {paramname} = PyObject_AsFileDescriptor({argname});
+ if ({paramname} == -1) {{{{
+ goto exit;
+ }}}}
+ """.format(argname=argname, paramname=self.name)
+
+
class float_converter(CConverter):
type = 'float'
default_type = float
diff --git a/Tools/peg_generator/pegen/sccutils.py b/Tools/peg_generator/pegen/sccutils.py
index 0c29519660..1f0586bb2f 100644
--- a/Tools/peg_generator/pegen/sccutils.py
+++ b/Tools/peg_generator/pegen/sccutils.py
@@ -18,7 +18,7 @@ def strongly_connected_components(
exactly once; vertices not part of a SCC are returned as
singleton sets.
- From https://github.com/ActiveState/code/tree/master/recipes/Python/578507_Strongly_connected_components_directed/recipe-578507.py.
+ From http://code.activestate.com/recipes/578507/.
"""
identified: Set[str] = set()
stack: List[str] = []
@@ -81,7 +81,7 @@ def topsort(
{B, C}
{A}
- From https://github.com/ActiveState/code/tree/master/recipes/Python/577413_Topological_Sort/recipe-577413.py.
+ From http://code.activestate.com/recipes/577413/.
"""
# TODO: Use a faster algorithm?
for k, v in data.items():