Ticket #17294: timezone.py.patch
File timezone.py.patch, 994 bytes (added by , 13 years ago) |
---|
-
django/utils/timezone.py
235 235 The logic is described in Python's docs: 236 236 http://docs.python.org/library/datetime.html#datetime.tzinfo 237 237 """ 238 return value.tzinfo is not None and value.tzinfo.utcoffset(value) is not None 238 if value is not None: 239 return value.tzinfo is not None and value.tzinfo.utcoffset(value) is not None 240 else: 241 return False 239 242 240 243 def is_naive(value): 241 244 """ … … 244 247 The logic is described in Python's docs: 245 248 http://docs.python.org/library/datetime.html#datetime.tzinfo 246 249 """ 247 return value.tzinfo is None or value.tzinfo.utcoffset(value) is None 250 if value is not None: 251 return value.tzinfo is None or value.tzinfo.utcoffset(value) is None 252 else: 253 return False 248 254 249 255 def make_aware(value, timezone): 250 256 """