OSDN Git Service
(root)
/
fukui-no-namari
/
fukui-no-namari.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09f77ec
)
Fix zero division.
author
Aiwota Programmer
<aiwotaprog@tetteke.tk>
Fri, 18 Aug 2006 06:12:44 +0000
(15:12 +0900)
committer
Aiwota Programmer
<aiwotaprog@tetteke.tk>
Fri, 18 Aug 2006 06:12:44 +0000
(15:12 +0900)
src/Hage1/board_window.py
patch
|
blob
|
history
diff --git
a/src/Hage1/board_window.py
b/src/Hage1/board_window.py
index
1f45821
..
afb58b4
100644
(file)
--- a/
src/Hage1/board_window.py
+++ b/
src/Hage1/board_window.py
@@
-193,7
+193,13
@@
class WinWrap:
else:
res = dic["res"]
start = int(id)
- dic["average"] = int(res * 60 * 60 * 24 / (lastmod - start))
+ # avoid the Last-Modified time of subject.txt and
+ # the build time of thread is equal (zero division)
+ dur = lastmod - start
+ if dur == 0:
+ dic["average"] = 999999
+ else:
+ dic["average"] = int(res * 60 * 60 * 24 / dur)
# lastModified
httpdate = dic["lastModified"]