[FIX] use text_type instead of unicode, use cmp from past.builtins
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index 028fa72..ddef657 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -3,6 +3,7 @@
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
+from past.builtins import cmp
 import frappe
 from frappe import _
 from frappe.model.document import Document
diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py
index f3e5203..ffe860e 100644
--- a/erpnext/accounts/report/financial_statements.py
+++ b/erpnext/accounts/report/financial_statements.py
@@ -4,7 +4,7 @@
 from __future__ import unicode_literals
 
 import re
-
+from past.builtins import cmp
 import functools
 
 import frappe
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 08460a0..c6d911a 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -11,6 +11,7 @@
 from erpnext.controllers.sales_and_purchase_return import validate_return
 from erpnext.accounts.party import get_party_account_currency, validate_party_frozen_disabled
 from erpnext.exceptions import InvalidCurrency
+from six import text_type
 
 force_item_fields = ("item_group", "brand", "stock_uom")
 
@@ -932,7 +933,7 @@
 @frappe.whitelist()
 def get_payment_term_details(term, posting_date=None, grand_total=None, bill_date=None):
 	term_details = frappe._dict()
-	if isinstance(term, unicode):
+	if isinstance(term, text_type):
 		term = frappe.get_doc("Payment Term", term)
 	else:
 		term_details.payment_term = term.payment_term