Skip to content

Commit 25d1734

Browse files
committed
[MLIR] Rename test/python/dialects/math.py -> math_dialect.py
Rename test/python/dialects/math.py -> math_dialect.py to avoid a collision with a Python standard package of the same name. These test scripts are run by path and are not part of a package. Python apparently implicitly adds the containing directory to its PYTHONPATH. As such, test scripts with common names run the risk of conflicting with global names and resolution of an import for the latter happens to the former. Differential Revision: https://reviews.llvm.org/D114568
1 parent ee1bf18 commit 25d1734

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mlir/test/python/dialects/math.py renamed to mlir/test/python/dialects/math_dialect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# RUN: %PYTHON %s | FileCheck %s
22

3+
# Naming this file with a `_dialect` suffix to avoid a naming conflict with
4+
# python package's math module (coming in from random.py).
5+
36
from mlir.ir import *
47
import mlir.dialects.builtin as builtin
58
import mlir.dialects.math as mlir_math

0 commit comments

Comments
 (0)