Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d6c5f790
Commit
d6c5f790
authored
Jan 23, 2005
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Truncate st_?time before comparing it with ST_?TIME in the tests.
parent
6571712a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
Doc/lib/libos.tex
Doc/lib/libos.tex
+3
-0
Lib/test/test_os.py
Lib/test/test_os.py
+5
-1
Misc/NEWS
Misc/NEWS
+1
-0
No files found.
Doc/lib/libos.tex
View file @
d6c5f790
...
...
@@ -1012,6 +1012,9 @@ objects. If newval is True, future calls to stat() return floats, if
it is False, future calls return ints. If newval is omitted, return
the current setting.
For compatibility with older Python versions, accessing
\class
{
stat
_
result
}
as a tuple always returns integers.
\versionchanged
[Python now returns float values by default. Applications
which do not work correctly with floating point time stamps can use
this function to restore the old behaviour]
{
2.5
}
...
...
Lib/test/test_os.py
View file @
d6c5f790
...
...
@@ -111,7 +111,11 @@ class StatAttributeTests(unittest.TestCase):
for
name
in
dir
(
stat
):
if
name
[:
3
]
==
'ST_'
:
attr
=
name
.
lower
()
self
.
assertEquals
(
getattr
(
result
,
attr
),
if
name
.
endswith
(
"TIME"
):
def
trunc
(
x
):
return
int
(
x
)
else
:
def
trunc
(
x
):
return
x
self
.
assertEquals
(
trunc
(
getattr
(
result
,
attr
)),
result
[
getattr
(
stat
,
name
)])
self
.
assert_
(
attr
in
members
)
...
...
Misc/NEWS
View file @
d6c5f790
...
...
@@ -151,6 +151,7 @@ C API
Tests
-----
-
In
test_os
,
st_
?
time
is
now
truncated
before
comparing
it
with
ST_
?
TIME
.
Mac
---
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment