From 381a9a45520ba56577e90032e086e0168a03b956 Mon Sep 17 00:00:00 2001 From: robot-piglet Date: Sat, 9 Nov 2024 12:07:32 +0300 Subject: Intermediate changes commit_hash:2e32c346f257520a6c3629b88dc628744d3d3386 --- contrib/python/ipython/py3/IPython/testing/tools.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'contrib/python/ipython/py3/IPython/testing') diff --git a/contrib/python/ipython/py3/IPython/testing/tools.py b/contrib/python/ipython/py3/IPython/testing/tools.py index b0303490482..aa54443ad06 100644 --- a/contrib/python/ipython/py3/IPython/testing/tools.py +++ b/contrib/python/ipython/py3/IPython/testing/tools.py @@ -36,7 +36,7 @@ from . import skipdoctest doctest_deco = skipdoctest.skip_doctest if sys.platform == 'win32' else dec.null_deco @doctest_deco -def full_path(startPath,files): +def full_path(startPath: str, files: list[str]) -> list[str]: """Make full paths for all the listed files, based on startPath. Only the base part of startPath is kept, since this routine is typically @@ -49,7 +49,7 @@ def full_path(startPath,files): Initial path to use as the base for the results. This path is split using os.path.split() and only its first component is kept. - files : string or list + files : list One or more files. Examples @@ -61,13 +61,8 @@ def full_path(startPath,files): >>> full_path('/foo',['a.txt','b.txt']) ['/a.txt', '/b.txt'] - If a single file is given, the output is still a list:: - - >>> full_path('/foo','a.txt') - ['/a.txt'] """ - - files = list_strings(files) + assert isinstance(files, list) base = os.path.split(startPath)[0] return [ os.path.join(base,f) for f in files ] -- cgit v1.3