try:
locale.setlocale(locale.LC_ALL, '')
- from pprint import pprint
+ except (ImportError, locale.Error):
+ pass # no locale support or unsupported locale
- def displayhook(value):
- if value is not None:
- __builtin__._ = value
- pprint(value)
+ # set displayhook
- sys.displayhook = displayhook
+ from pprint import pprint
- except (ImportError, locale.Error):
- pass # no locale support or unsupported locale
+ def displayhook(value):
+ if value is not None:
+ __builtin__._ = value
+ pprint(value)
+
+ sys.displayhook = displayhook
# utilities