summaryrefslogtreecommitdiff
path: root/Cython/Compiler/Tests/TestCmdLine.py
diff options
context:
space:
mode:
authorLisandro Dalcin <dalcinl@gmail.com>2023-04-30 14:02:48 +0400
committerGitHub <noreply@github.com>2023-04-30 13:02:48 +0300
commit10cf5f6e18dbce625d32407a857cc06dd2cec637 (patch)
tree1afb328f9e119340e2a36f55a2bf7d4a68de9677 /Cython/Compiler/Tests/TestCmdLine.py
parentcdce132997b60ace744da88572ee457e3a9444de (diff)
downloadcython-10cf5f6e18dbce625d32407a857cc06dd2cec637.tar.gz
CmdLine: Fix regression when using the `--working` option (GH-5365)
Checking for the existence of source files must account for the user-specified working directory. If the source filename is not absolute, prepend the working directory if specified, then perform the check.
Diffstat (limited to 'Cython/Compiler/Tests/TestCmdLine.py')
-rw-r--r--Cython/Compiler/Tests/TestCmdLine.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/Cython/Compiler/Tests/TestCmdLine.py b/Cython/Compiler/Tests/TestCmdLine.py
index 0961dfa03..290efd1d7 100644
--- a/Cython/Compiler/Tests/TestCmdLine.py
+++ b/Cython/Compiler/Tests/TestCmdLine.py
@@ -20,7 +20,17 @@ unpatched_exists = os.path.exists
def patched_exists(path):
# avoid the Cython command raising a file not found error
- if path in ('source.pyx', 'file.pyx', 'file1.pyx', 'file2.pyx', 'file3.pyx', 'foo.pyx', 'bar.pyx'):
+ if path in (
+ 'source.pyx',
+ os.path.join('/work/dir', 'source.pyx'),
+ os.path.join('my_working_path', 'source.pyx'),
+ 'file.pyx',
+ 'file1.pyx',
+ 'file2.pyx',
+ 'file3.pyx',
+ 'foo.pyx',
+ 'bar.pyx',
+ ):
return True
return unpatched_exists(path)