Advertisement
Guest User

Untitled

a guest
Nov 18th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. >>> from keystone import exception
  2. >>> e = exception.Error('what?')
  3. >>> import six
  4. >>> six.text_type(e)
  5. u'what?'
  6. >>> type(e)
  7. <class 'keystone.exception.Error'>
  8. >>> type(six.text_type(e))
  9. <type 'unicode'>
  10. >>> import logging
  11. >>> logging.exception(six.text_type(e))
  12. ERROR:root:what?
  13. None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement