mirror of https://github.com/sipwise/kamailio.git
Removed: * sipwise/switch_from_python2_to_python3.patch Change-Id: Ifd0979f259d14d4f81073cd97a2ebc86e0b47d4cchanges/49/34149/1
parent
0cdd638256
commit
56a2578c33
@ -1,86 +0,0 @@
|
||||
--- a/utils/kamctl/dbtextdb/__init__.py
|
||||
+++ b/utils/kamctl/dbtextdb/__init__.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
#
|
||||
# Copyright 2008 Google Inc. All Rights Reserved.
|
||||
|
||||
--- a/utils/kamctl/dbtextdb/dbtextdb.py
|
||||
+++ b/utils/kamctl/dbtextdb/dbtextdb.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
#
|
||||
# Copyright 2008 Google Inc. All Rights Reserved.
|
||||
|
||||
@@ -27,7 +27,7 @@ else:
|
||||
def Debug(msg):
|
||||
"""Debug print method."""
|
||||
if DEBUG:
|
||||
- print msg
|
||||
+ print(msg)
|
||||
|
||||
|
||||
class DBText(object):
|
||||
@@ -958,11 +958,11 @@ class DBText(object):
|
||||
try:
|
||||
if val:
|
||||
val = eval(val)
|
||||
- except NameError, e:
|
||||
+ except NameError as e:
|
||||
raise ExecuteError('Failed to parse %s in %s '
|
||||
'(unable to convert to type %s): %s' %
|
||||
(col, self.table, self.header[col]['type'], e))
|
||||
- except SyntaxError, e:
|
||||
+ except SyntaxError as e:
|
||||
raise ExecuteError('Failed to parse %s in %s '
|
||||
'(unable to convert to type %s): %s' %
|
||||
(col, self.table, self.header[col]['type'], e))
|
||||
@@ -1045,7 +1045,7 @@ class DBText(object):
|
||||
self.data = self._GetData()
|
||||
self.orig_data = self.data[:] # save a copy of the data before modifying
|
||||
|
||||
- except IOError, e:
|
||||
+ except IOError as e:
|
||||
raise ExecuteError('Unable to open table %s: %s' % (self.table, e))
|
||||
|
||||
Debug('Header is: %s' % self.header)
|
||||
@@ -1172,11 +1172,11 @@ class ExecuteError(Error):
|
||||
def main(argv):
|
||||
|
||||
if len(argv) < 2:
|
||||
- print 'Usage %s query' % argv[0]
|
||||
+ print('Usage %s query' % argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
if 'DBTEXT_PATH' not in os.environ or not os.environ['DBTEXT_PATH']:
|
||||
- print 'DBTEXT_PATH must be set'
|
||||
+ print('DBTEXT_PATH must be set')
|
||||
sys.exit(1)
|
||||
else:
|
||||
location = os.environ['DBTEXT_PATH']
|
||||
@@ -1187,11 +1187,11 @@ def main(argv):
|
||||
if dataset:
|
||||
for row in dataset:
|
||||
if conn.command != 'SELECT':
|
||||
- print 'Updated %s, rows affected: %d' % (conn.table, row)
|
||||
+ print('Updated %s, rows affected: %d' % (conn.table, row))
|
||||
else:
|
||||
- print row
|
||||
- except Error, e:
|
||||
- print e
|
||||
+ print(row)
|
||||
+ except Error as e:
|
||||
+ print(e)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
--- a/utils/kamctl/dbtextdb/dbtextdb_test.py
|
||||
+++ b/utils/kamctl/dbtextdb/dbtextdb_test.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
#
|
||||
# Copyright 2008 Google Inc. All Rights Reserved.
|
||||
|
Loading…
Reference in new issue