NameError: name 'datetime' is not defined

I am getting this error after adding a file to after that i have removed the code which was a after_login trigger. It would be a great help if anyone could solve this

Traceback (most recent call last):
  File "apps/frappe/frappe/", line 55, in application
  File "apps/frappe/frappe/", line 129, in init_request
    frappe.local.http_request = frappe.auth.HTTPRequest()
  File "apps/frappe/frappe/", line 34, in __init__
  File "apps/frappe/frappe/", line 70, in set_session
    frappe.local.login_manager = LoginManager()
  File "apps/frappe/frappe/", line 119, in __init__
  File "apps/frappe/frappe/", line 207, in make_session
    frappe.local.session_obj = Session(
  File "apps/frappe/frappe/", line 239, in __init__
  File "apps/frappe/frappe/", line 310, in resume
    data = self.get_session_record()
  File "apps/frappe/frappe/", line 328, in get_session_record
    r = self.get_session_data()
  File "apps/frappe/frappe/", line 344, in get_session_data
    data = self.get_session_data_from_db()
  File "apps/frappe/frappe/", line 389, in get_session_data_from_db
    data = frappe._dict(frappe.safe_eval(rec and rec[0][1] or "{}"))
  File "apps/frappe/frappe/", line 2298, in safe_eval
    return eval(code, eval_globals, eval_locals)
  File "<string>", line 1, in <module>
NameError: name 'datetime' is not defined