Skip to content

Commit 8e3fd00

Browse files
committed
cruft removal 2
1 parent dd23624 commit 8e3fd00

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

pymongo/errors.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ def __init__(self, error, code=None, details=None, max_wire_version=None):
154154
self.__details = details
155155
self.__max_wire_version = max_wire_version
156156

157+
def __str__(self):
158+
output_str = "%s, full error: %s" % (self._message, self.__details)
159+
if sys.version_info[0] == 2 and isinstance(output_str, unicode):
160+
return output_str.encode('utf-8', errors='replace')
161+
return output_str
162+
157163
@property
158164
def _max_wire_version(self):
159165
return self.__max_wire_version
@@ -176,21 +182,6 @@ def details(self):
176182
"""
177183
return self.__details
178184

179-
@property
180-
def max_wire_version(self):
181-
"""The latest version of the wire protocol supported by the socket
182-
that was used to run the operation that raised this exception.
183-
184-
PyMongo does not always record this value and it may be None.
185-
"""
186-
return self.__max_wire_version
187-
188-
def __str__(self):
189-
output_str = "%s, full error: %s" % (self._message, self.__details)
190-
if sys.version_info[0] == 2 and isinstance(output_str, unicode):
191-
return output_str.encode('utf-8', errors='replace')
192-
return output_str
193-
194185

195186
class CursorNotFound(OperationFailure):
196187
"""Raised while iterating query results if the cursor is

0 commit comments

Comments
 (0)