summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index b9de479..5bdc103 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -192,6 +192,9 @@ class Request:
# Begin deprecated methods
def add_data(self, data):
+ if self.has_data():
+ raise TypeError("Request Obj already contains data: %s" %
+ self.data)
self.data = data
def has_data(self):