]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Avoid concatenating bytes with strings
authorJayson Reis <santosdosreis@gmail.com>
Tue, 19 Jan 2016 13:19:03 +0000 (14:19 +0100)
committerJayson Reis <santosdosreis@gmail.com>
Tue, 19 Jan 2016 13:19:03 +0000 (14:19 +0100)
vcr/stubs/__init__.py

index b3726587fa3454d4188632b12b58cd29545acb8d..a703ff43723de77f14ae2e154b659f0d2a26b9de 100644 (file)
@@ -191,7 +191,8 @@ class VCRConnection(object):
         body of the request.  So if that happens, let's just append the data
         onto the most recent request in the cassette.
         '''
-        self._vcr_request.body = (self._vcr_request.body or '') + data
+        self._vcr_request.body = self._vcr_request.body + data \
+            if self._vcr_request.body else data
 
     def close(self):
         # Note: the real connection will only close if it's open, so