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 1e4e679 commit df9d509Copy full SHA for df9d509
plugins/python3/src/policy.rs
@@ -28,10 +28,15 @@ impl StudentFilePolicy for Python3StudentFilePolicy {
28
|| path
29
.components()
30
.any(|c| c.as_os_str() == OsStr::new("__pycache__"));
31
+
32
// .py files in exercise root are student source files
- let is_py_in_root = path.extension() == Some(OsStr::new("py")) && path.parent().is_none();
33
+ let is_in_project_root = match path.parent() {
34
+ Some(s) => s.as_os_str().is_empty(),
35
+ None => true,
36
+ };
37
+ let is_py_file = path.extension() == Some(OsStr::new("py"));
38
- in_src && !is_cache_file || is_py_in_root
39
+ in_src && !is_cache_file || is_in_project_root && is_py_file
40
}
41
42
0 commit comments