Skip to content
This repository has been archived by the owner on Jun 11, 2018. It is now read-only.

Commit

Permalink
doc: note about hasattr() on Python 2.7 vs. 3 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jul 26, 2017
1 parent 7d01940 commit 372792e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions opbeat/contrib/django/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def get_data_from_request(self, request):
try:
try:
# Django 1.4+
# NOTE: on Python 2.7 `hasattr(request, 'body')` returns
# False, while it might throw the exception from Django in
# Python 3.
raw_data = request.body
except AttributeError:
raw_data = request.raw_post_data
Expand Down

0 comments on commit 372792e

Please sign in to comment.