We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24f0ae3 commit 8bf7ae9Copy full SHA for 8bf7ae9
robotpy/main.py
@@ -49,6 +49,17 @@ def _load_robot_class():
49
print(f"ERROR: {robot_py_path} is a directory", file=sys.stderr)
50
sys.exit(1)
51
52
+ # Ensure that it's robot.py and not Robot.py or similar by checking the
53
+ # directory entries of its parent
54
+ lower_name = robot_py_path.name.lower()
55
+ for entry in robot_py_path.parent.iterdir():
56
+ if entry.name.lower() == lower_name and entry.name != robot_py_path.name:
57
+ print(
58
+ f"ERROR: {robot_py_path} must be {robot_py_path.name} (found '{entry.name}')",
59
+ file=sys.stderr,
60
+ )
61
+ sys.exit(1)
62
+
63
# Add that directory to sys.path to ensure that imports work as expected
64
sys.path.insert(0, str(robot_py_path.parent.absolute()))
65
0 commit comments