mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
st_file_attributes (#6353)
This commit is contained in:
1 parent
abc5c223a6
commit
a484ba4790
3 files changed
+9
-2
No files matched your search
Vendored
-1
@@ -714,7 +714,6 @@ class StatAttributeTests(unittest.TestCase):
|
||||
self.assertTrue(isinstance(result.st_file_attributes, int))
|
||||
self.assertTrue(0 <= result.st_file_attributes <= 0xFFFFFFFF)
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON; os.stat return value doesnt have st_file_attributes attribute')
|
||||
@unittest.skipUnless(sys.platform == "win32",
|
||||
"st_file_attributes is Win32 specific")
|
||||
def test_file_attributes(self):
|
||||
|
||||
Vendored
-1
@@ -223,7 +223,6 @@ class HelperFunctionsTests(unittest.TestCase):
|
||||
finally:
|
||||
pth_file.cleanup()
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON
|
||||
@unittest.skipUnless(sys.platform == 'win32', 'test needs Windows')
|
||||
@support.requires_subprocess()
|
||||
def test_addsitedir_hidden_file_attribute(self):
|
||||
|
||||
@@ -801,6 +801,9 @@ pub(super) mod _os {
|
||||
#[pyarg(any, default)]
|
||||
#[pystruct_sequence(skip)]
|
||||
pub st_reparse_tag: u32,
|
||||
#[pyarg(any, default)]
|
||||
#[pystruct_sequence(skip)]
|
||||
pub st_file_attributes: u32,
|
||||
}
|
||||
|
||||
impl StatResultData {
|
||||
@@ -835,6 +838,11 @@ pub(super) mod _os {
|
||||
#[cfg(not(windows))]
|
||||
let st_reparse_tag = 0;
|
||||
|
||||
#[cfg(windows)]
|
||||
let st_file_attributes = stat.st_file_attributes;
|
||||
#[cfg(not(windows))]
|
||||
let st_file_attributes = 0;
|
||||
|
||||
Self {
|
||||
st_mode: vm.ctx.new_pyref(stat.st_mode),
|
||||
st_ino: vm.ctx.new_pyref(stat.st_ino),
|
||||
@@ -853,6 +861,7 @@ pub(super) mod _os {
|
||||
st_mtime_ns: to_ns(mtime),
|
||||
st_ctime_ns: to_ns(ctime),
|
||||
st_reparse_tag,
|
||||
st_file_attributes,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user