Skip to content

Commit 5e31a8d

Browse files
author
Greg Taylor
committed
More comments for delete shipments example, and making the FedexError exception less reliant on your Python version being aware of __unicode__().
1 parent a039f79 commit 5e31a8d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

examples/delete_shipment.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
del_request = FedexDeleteShipmentRequest(CONFIG_OBJ)
1515

1616
# Either delete all packages in a shipment, or delete an individual package.
17+
# Docs say this isn't required, but the WSDL won't validate without it.
1718
# DELETE_ALL_PACKAGES, DELETE_ONE_PACKAGE
1819
del_request.DeletionControlType = "DELETE_ALL_PACKAGES"
1920

2021
# The tracking number of the shipment to delete.
2122
del_request.TrackingId.TrackingNumber = '794798682968'
2223

2324
# What kind of shipment the tracking number used.
25+
# Docs say this isn't required, but the WSDL won't validate without it.
2426
# EXPRESS, GROUND, or USPS
2527
del_request.TrackingId.TrackingIdType = 'EXPRESS'
2628

fedex/base_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ class FedexBaseServiceException(Exception):
1919
def __init__(self, error_code, value):
2020
self.error_code = error_code
2121
self.value = value
22-
def __str__(self):
22+
def __unicode__(self):
2323
return "%s (Error code: %s)" % (repr(self.value), self.error_code)
24+
def __str__(self):
25+
return self.__unicode__()
2426

2527
class FedexFailure(FedexBaseServiceException):
2628
"""

0 commit comments

Comments
 (0)