mirror of
https://github.com/davidkeegan/dklrt
synced 2024-12-25 09:59:19 +01:00
Applied python 2to3
This commit is contained in:
parent
013af926c9
commit
469468e72c
2 changed files with 3 additions and 4 deletions
1
Misc.py
1
Misc.py
|
@ -2,7 +2,6 @@
|
|||
# Miscellaneous Utilities (dklrt).
|
||||
# (c) David Keegan 2011-06-28.
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
|
||||
def Out(*Args):
|
||||
|
|
6
Time.py
6
Time.py
|
@ -60,7 +60,7 @@ def DateAddYears(Seconds, Count):
|
|||
If Seconds is Feb 29, shifts to Feb 28, even if shifing to a
|
||||
leap year.
|
||||
"""
|
||||
if not isinstance(Count, (int, long)):
|
||||
if not isinstance(Count, int):
|
||||
_Throw("Count argument not an int!")
|
||||
|
||||
dtd = datetime.date.fromtimestamp(Seconds)
|
||||
|
@ -74,14 +74,14 @@ def DateAddMonths(Seconds, Count):
|
|||
"""Shifts Seconds (a date) forward by Count months.
|
||||
If the day is >= 29, shifts to 28.
|
||||
"""
|
||||
if not isinstance(Count, (int, long)):
|
||||
if not isinstance(Count, int):
|
||||
_Throw("Count argument not an int!")
|
||||
|
||||
dtd = datetime.date.fromtimestamp(Seconds)
|
||||
if not Count == 0:
|
||||
if dtd.day >= 29: dtd = dtd.replace(day=28)
|
||||
Month = (dtd.month + Count) - 1
|
||||
Years = Month / 12
|
||||
Years = Month // 12
|
||||
dtd = dtd.replace(year=(dtd.year + Years))
|
||||
Month = (Month % 12) + 1
|
||||
dtd = dtd.replace(month=Month)
|
||||
|
|
Loading…
Reference in a new issue