summaryrefslogtreecommitdiff
path: root/fastimport/dates.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-04-04 02:05:37 +0200
committerJelmer Vernooij <jelmer@samba.org>2012-04-04 02:05:37 +0200
commit55170a74a2999fa5bcdd6099523831371c3be204 (patch)
tree3fbaabc79559662146fc66a8afc7406de79c2612 /fastimport/dates.py
parentf4d52ab7bf5eae5f12f8dee300543bc827ed473b (diff)
downloadpython-fastimport-55170a74a2999fa5bcdd6099523831371c3be204.tar.gz
Cope with invalid timezones like +51800 a little bit better.
Diffstat (limited to 'fastimport/dates.py')
-rw-r--r--fastimport/dates.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/fastimport/dates.py b/fastimport/dates.py
index c0cf400..65223f8 100644
--- a/fastimport/dates.py
+++ b/fastimport/dates.py
@@ -48,11 +48,11 @@ def parse_tz(tz):
:return: the timezone offset in seconds.
"""
# from git_repository.py in bzr-git
- if len(tz) != 5:
+ if tz[0] not in ('+', '-'):
raise ValueError(tz)
sign = {'+': +1, '-': -1}[tz[0]]
- hours = int(tz[1:3])
- minutes = int(tz[3:])
+ hours = int(tz[1:-2])
+ minutes = int(tz[-2:])
return sign * 60 * (60 * hours + minutes)