~tribaal/txaws/xss-hardening

« back to all changes in this revision

Viewing changes to txaws/server/resource.py

  • Committer: Thomas Hervé
  • Date: 2012-01-06 09:54:09 UTC
  • mfrom: (105.1.2 txaws-drop-epsilon)
  • Revision ID: thomas@canonical.com-20120106095409-zq8j2xexnldl927b
Merge drop-pytz [r=therve] [a=clint-fewbar] [f=912589]

Use dateutil instead of pytz in txaws.server

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from datetime import datetime, timedelta
2
2
from uuid import uuid4
3
 
from pytz import UTC
 
3
from dateutil.tz import tzutc
4
4
 
5
5
from twisted.python import log
6
6
from twisted.python.reflect import safe_str
159
159
 
160
160
    def get_utc_time(self):
161
161
        """Return a C{datetime} object with the current time in UTC."""
162
 
        return datetime.now(UTC)
 
162
        return datetime.now(tzutc())
163
163
 
164
164
    def _validate(self, request):
165
165
        """Validate an L{HTTPRequest} before executing it.