mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-18 19:07:55 +00:00
Python 3 compatibility syntax error fixes (#10519)
* Use Python 3 style print function * Use 'Exception as e' instead of 'Exception, e' * Unpack tuple arguments explicitly in instead of relying on auto unpacking * Use consistent indentation * Use 0 if stock_frozen_upto_days is None
This commit is contained in:
committed by
Rushabh Mehta
parent
7ed4bfe7ee
commit
6ccb6562f1
@@ -1,7 +1,7 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import print_function, unicode_literals
|
||||
import unittest
|
||||
import frappe
|
||||
from frappe.utils.nestedset import NestedSetRecursionError, NestedSetMultipleRootsError, \
|
||||
@@ -112,7 +112,7 @@ class TestItem(unittest.TestCase):
|
||||
|
||||
def print_tree(self):
|
||||
import json
|
||||
print json.dumps(frappe.db.sql("select name, lft, rgt from `tabItem Group` order by lft"), indent=1)
|
||||
print(json.dumps(frappe.db.sql("select name, lft, rgt from `tabItem Group` order by lft"), indent=1))
|
||||
|
||||
def test_move_leaf_into_another_group(self):
|
||||
# before move
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
@@ -19,10 +19,10 @@ def after_install():
|
||||
|
||||
def check_setup_wizard_not_completed():
|
||||
if frappe.db.get_default('desktop:home_page') == 'desktop':
|
||||
print
|
||||
print "ERPNext can only be installed on a fresh site where the setup wizard is not completed"
|
||||
print "You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall"
|
||||
print
|
||||
print()
|
||||
print("ERPNext can only be installed on a fresh site where the setup wizard is not completed")
|
||||
print("You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall")
|
||||
print()
|
||||
return False
|
||||
|
||||
def set_single_defaults():
|
||||
|
||||
Reference in New Issue
Block a user