summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwang biao <biao716.wang@samsung.com>2023-05-23 16:12:41 +0800
committerJinWang An <jinwang.an@samsung.com>2023-08-09 08:14:07 +0000
commitf91759036f80e42b794f0fde0e56f36169de5a07 (patch)
tree343287f07b038197595a4c60db018429e9c20e54
parentb7d6e97665e9daa8c501ccfa02b7eaff383ca36a (diff)
downloadlibzypp-bindings-f91759036f80e42b794f0fde0e56f36169de5a07.tar.gz
libzypp-bindings-f91759036f80e42b794f0fde0e56f36169de5a07.tar.bz2
libzypp-bindings-f91759036f80e42b794f0fde0e56f36169de5a07.zip
change python version to 3.x
Change-Id: If1771c313a788982ad6a53973280de000383721c Signed-off-by: wang biao <biao716.wang@samsung.com> (cherry picked from commit b34d5de51cc9f3b16c9508b2e43fd5171e1e6164)
-rw-r--r--examples/python/SimpleWalkthrough.py56
-rwxr-xr-xexamples/python/bytecount.py6
-rwxr-xr-xexamples/python/date.py6
-rwxr-xr-xexamples/python/exception.py8
-rwxr-xr-xexamples/python/install_updates_dryrun.py18
-rwxr-xr-xexamples/python/keyring.py16
-rwxr-xr-xexamples/python/list_resolvables.py8
-rwxr-xr-xexamples/python/url.py16
-rw-r--r--packaging/libzypp-bindings.spec18
-rw-r--r--swig/CMakeLists.txt8
-rw-r--r--swig/python/CMakeLists.txt12
-rw-r--r--swig/python/tests/callbacks.py22
-rw-r--r--swig/python/tests/commit_callbacks.py20
-rw-r--r--swig/python/tests/installed_path.py6
-rw-r--r--swig/python/tests/problems.py2
15 files changed, 111 insertions, 111 deletions
diff --git a/examples/python/SimpleWalkthrough.py b/examples/python/SimpleWalkthrough.py
index a1b6d94..e14cc87 100644
--- a/examples/python/SimpleWalkthrough.py
+++ b/examples/python/SimpleWalkthrough.py
@@ -3,43 +3,43 @@ import zypp
# ========================================================================================
def poolInstall( Z, capstr ):
- print "Request: install %s" % capstr
+ print("Request: install %s" % capstr)
Z.resolver().addRequire( zypp.Capability( capstr ) )
def poolRemove( Z, capstr ):
- print "Request: delete %s" % capstr
+ print("Request: delete %s" % capstr)
Z.resolver().addConflict( zypp.Capability( capstr ) )
def poolPrintTransaction( Z ):
todo = Z.pool().getTransaction()
for item in todo._toDelete:
- print '-- %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() )
+ print('-- %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() ))
for item in todo._toInstall:
- print '++ %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() )
+ print('++ %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() ))
def poolResolve( Z ):
- print "Resolve pool:"
+ print("Resolve pool:")
while not Z.resolver().resolvePool():
# Print _all_ problems and possible solutions:
problems = Z.resolver().problems()
pn = 0
for problem in problems:
pn += 1
- print "Problem %d:" % pn
- print "=============================="
- print problem.description()
+ print("Problem %d:" % pn)
+ print("==============================")
+ print(problem.description())
if problem.details():
- print problem.details()
- print "------------------------------"
+ print(problem.details())
+ print("------------------------------")
sn = 0
for solution in problem.solutions():
sn += 1
- print "Solution %d.%d:" % ( pn, sn )
- print solution.description()
+ print("Solution %d.%d:" % ( pn, sn ))
+ print(solution.description())
if solution.details():
- print solution.details()
- print "=============================="
- print
+ print(solution.details())
+ print("==============================")
+ print()
# Faked user interaction: stupidly pick all 1st solutions (don't do this in real life!)
#
@@ -54,26 +54,26 @@ def poolResolve( Z ):
sn = 0
for solution in problem.solutions():
sn += 1
- print "Stupidly pick solution %d.%d" % ( pn, sn )
+ print("Stupidly pick solution %d.%d" % ( pn, sn ))
pickedSolutions.push_back( solution )
break
# Apply picked solutions:
Z.resolver().applySolutions( pickedSolutions )
#
- print "Example stops here instead of starting a new iteration..."
- print
+ print("Example stops here instead of starting a new iteration...")
+ print()
raise BaseException("Solver Error")
poolPrintTransaction( Z )
- print "[done]"
+ print("[done]")
def poolUpdate( Z ):
# In contrary to
- print "Update pool:"
+ print("Update pool:")
Z.resolver().doUpdate()
poolPrintTransaction( Z )
- print "[done]"
+ print("[done]")
# ========================================================================================
Z = zypp.ZYppFactory_instance().getZYpp()
@@ -95,13 +95,13 @@ for repo in repoManager.knownRepositories():
# Now all installed and available items are in the pool:
#
-print "Known items: %d" % ( Z.pool().size() )
+print("Known items: %d" % ( Z.pool().size() ))
if True:
# Iterate the pool to query items. PoolItems are not just packages
# but also patterns, patches, products, ...
# PoolItem provides the common attributes and status. For specific
# attibutes cast the item inot the specific kind.
- print "Printing just the Products..."
+ print("Printing just the Products...")
for item in Z.pool():
if not zypp.isKindProduct( item ):
continue
@@ -110,18 +110,18 @@ if True:
t = "i"
else:
t = "*"
- print "%s %s:%s-%s.%s\t(%s)" % ( t,
+ print("%s %s:%s-%s.%s\t(%s)" % ( t,
item.kind(),
item.name(),
item.edition(),
item.arch(),
- item.repoInfo().alias() )
+ item.repoInfo().alias() ))
# How to access e.g. product specific attributes:
if zypp.isKindProduct( item ):
prod = zypp.asKindProduct( item )
- print " %s (%s)" % ( prod.shortName(), prod.flavor() )
- print
+ print(" %s (%s)" % ( prod.shortName(), prod.flavor() ))
+ print()
# Building and resolving a transaction:
#
@@ -144,4 +144,4 @@ policy.syncPoolAfterCommit( False )
policy.dryRun( True )
result = Z.commit( policy )
-print result
+print(result)
diff --git a/examples/python/bytecount.py b/examples/python/bytecount.py
index 912fa05..a21b4ce 100755
--- a/examples/python/bytecount.py
+++ b/examples/python/bytecount.py
@@ -2,9 +2,9 @@
from zypp import ByteCount
-print ByteCount(ByteCount.G)
-print ByteCount(ByteCount.GB)
+print(ByteCount(ByteCount.G))
+print(ByteCount(ByteCount.GB))
x = ByteCount(ByteCount.K)
-print int(x)
+print(int(x))
diff --git a/examples/python/date.py b/examples/python/date.py
index 965d2f3..e467ac1 100755
--- a/examples/python/date.py
+++ b/examples/python/date.py
@@ -2,9 +2,9 @@
from zypp import Date
-print Date()
+print(Date())
d = Date.now()
-print d
-print d.form("%F %T")
+print(d)
+print(d.form("%F %T"))
diff --git a/examples/python/exception.py b/examples/python/exception.py
index 9b7e6ec..fdcfcef 100755
--- a/examples/python/exception.py
+++ b/examples/python/exception.py
@@ -17,9 +17,9 @@ try:
repo_manager.addRepository(repo_info)
repo_manager.refreshMetadata(repo_info)
repo_manager.buildCache(repo_info)
-except RuntimeError, strerror:
- print "RuntimeError"
- print strerror
+except RuntimeError as strerror:
+ print("RuntimeError")
+ print(strerror)
else:
- print "Oh, no exception"
+ print("Oh, no exception")
diff --git a/examples/python/install_updates_dryrun.py b/examples/python/install_updates_dryrun.py
index ba1a134..de83e5d 100755
--- a/examples/python/install_updates_dryrun.py
+++ b/examples/python/install_updates_dryrun.py
@@ -5,9 +5,9 @@ import os, sys, types, string, re
try:
import zypp
except ImportError:
- print 'Dummy Import Error: Unable to import zypp bindings'
+ print('Dummy Import Error: Unable to import zypp bindings')
-print 'Reading repositories...'
+print('Reading repositories...')
Z = zypp.ZYppFactory_instance().getZYpp()
Z.initializeTarget( zypp.Pathname("/") )
Z.target().load();
@@ -21,7 +21,7 @@ for repo in repos:
if not repoManager.isCached( repo ):
repoManager.buildCache( repo )
repoManager.loadFromCache( repo );
-print "Items: %d" % ( Z.pool().size() )
+print("Items: %d" % ( Z.pool().size() ))
#
# Does not to check and apply updates for the update stack first.
@@ -35,26 +35,26 @@ for item in Z.pool():
if not item.status().setTransact( True, zypp.ResStatus.USER ):
raise "Error set transact: %s" % item
resolvable = zypp.asKindPatch( item )
- print '%s | %s-%s | %s | %s' % (resolvable.repoInfo().alias(), resolvable.name(), resolvable.edition(), resolvable.category(), item.status() )
+ print('%s | %s-%s | %s | %s' % (resolvable.repoInfo().alias(), resolvable.name(), resolvable.edition(), resolvable.category(), item.status() ))
if not Z.resolver().resolvePool():
raise "Solver Error"
for item in Z.pool():
if item.status().transacts():
- print '%s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() )
+ print('%s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() ))
#
#
#
-print '===================================================='
+print('====================================================')
todo = zypp.GetResolvablesToInsDel( Z.pool() )
for item in todo._toDelete:
- print '-- %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() )
+ print('-- %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() ))
for item in todo._toInstall:
- print '++ %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() )
+ print('++ %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() ))
#
# dryRun!
@@ -65,4 +65,4 @@ policy.dryRun( True )
policy.syncPoolAfterCommit( False )
result = Z.commit( policy )
-print result
+print(result)
diff --git a/examples/python/keyring.py b/examples/python/keyring.py
index 83cf5ff..c453958 100755
--- a/examples/python/keyring.py
+++ b/examples/python/keyring.py
@@ -12,24 +12,24 @@ from zypp import ZYppFactory, Pathname, KeyRing, PublicKey
keyring = ZYppFactory.instance().getZYpp().keyRing()
path = Pathname("/suse/aschnell/tmp/repodata/repomd.xml.key")
-print path
+print(path)
publickey = PublicKey(path)
-print publickey
+print(publickey)
id = publickey.id()
-print "is key known/trusted %s %s" % (keyring.isKeyKnown(id), keyring.isKeyTrusted(id))
+print("is key known/trusted %s %s" % (keyring.isKeyKnown(id), keyring.isKeyTrusted(id)))
keyring.importKey(publickey, True)
-print "is key known/trusted %s %s" % (keyring.isKeyKnown(id), keyring.isKeyTrusted(id))
+print("is key known/trusted %s %s" % (keyring.isKeyKnown(id), keyring.isKeyTrusted(id)))
-print "list of known keys:"
+print("list of known keys:")
for key in keyring.publicKeys():
- print key
+ print(key)
-print "list of trusted keys:"
+print("list of trusted keys:")
for key in keyring.trustedPublicKeys():
- print key
+ print(key)
diff --git a/examples/python/list_resolvables.py b/examples/python/list_resolvables.py
index 8138390..254acc3 100755
--- a/examples/python/list_resolvables.py
+++ b/examples/python/list_resolvables.py
@@ -15,7 +15,7 @@ for repo in repos:
repoManager.buildCache( repo )
repoManager.loadFromCache( repo );
-print "Items: %d" % ( Z.pool().size() )
+print("Items: %d" % ( Z.pool().size() ))
for item in Z.pool():
if item.status().isInstalled():
@@ -23,11 +23,11 @@ for item in Z.pool():
else:
t = "*"
- print "%s %s:%s-%s.%s\t(%s)" % ( t,
+ print("%s %s:%s-%s.%s\t(%s)" % ( t,
item.kind(),
item.name(),
item.edition(),
item.arch(),
- item.repoInfo().alias() )
+ item.repoInfo().alias() ))
if zypp.isKindPackage( item ):
- print " Group: %s" %(zypp.asKindPackage( item ).group( ) )
+ print(" Group: %s" %(zypp.asKindPackage( item ).group( ) ))
diff --git a/examples/python/url.py b/examples/python/url.py
index 07c772c..e430bf0 100755
--- a/examples/python/url.py
+++ b/examples/python/url.py
@@ -3,19 +3,19 @@
from zypp import Url
a = Url("http://www.suse.de/download")
-print "a = %s" % a
-print " %s %s %s" % (a.getScheme(), a.getHost(), a.getPathData())
+print("a = %s" % a)
+print(" %s %s %s" % (a.getScheme(), a.getHost(), a.getPathData()))
b = Url(a)
b.setHost("download.novell.com")
-print "b = %s" % b
+print("b = %s" % b)
c = a # oops
c.setPathData("/repository")
-print "c = %s" % c
+print("c = %s" % c)
-print
-print "a = %s" % a # oops
-print "b = %s" % b
-print "c = %s" % c
+print()
+print("a = %s" % a) # oops
+print("b = %s" % b)
+print("c = %s" % c)
diff --git a/packaging/libzypp-bindings.spec b/packaging/libzypp-bindings.spec
index 652af93..608f6d1 100644
--- a/packaging/libzypp-bindings.spec
+++ b/packaging/libzypp-bindings.spec
@@ -17,7 +17,7 @@ Source: %{name}-%{version}.tar.gz
Source1001: libzypp-bindings.manifest
Source1002: Fix_Swig_Source.patch
-BuildRequires: cmake gcc-c++ python-devel
+BuildRequires: cmake gcc-c++ python3-devel
BuildRequires: swig
BuildRequires: libzypp-devel
@@ -34,7 +34,7 @@ cp %{SOURCE1001} .
mkdir build
cd build
%cmake -DCMAKE_INSTALL_PREFIX=%{prefix} \
- -DPYTHON_SITEDIR=%{python_sitearch} \
+ -DPYTHON_SITEDIR=%{python3_sitearch} \
-DLIB=%{_lib} \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags}" \
@@ -50,17 +50,17 @@ make install DESTDIR=$RPM_BUILD_ROOT
%clean
-%package -n python-zypp
-Summary: Python bindings for libzypp
+%package -n python3-zypp
+Summary: Python3 bindings for libzypp
Group: Development/Languages/Python
Requires: libzypp
-%description -n python-zypp
-Python bindings of libzypp
+%description -n python3-zypp
+Python3 bindings of libzypp
-%files -n python-zypp
+%files -n python3-zypp
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%{python_sitearch}/_zypp.so
-%{python_sitearch}/zypp.py*
+%{python3_sitearch}/_zypp.so
+%{python3_sitearch}/zypp.py*
diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt
index acf23f6..b10190c 100644
--- a/swig/CMakeLists.txt
+++ b/swig/CMakeLists.txt
@@ -12,7 +12,7 @@ SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/zypp.i" )
#
OPTION(BUILD_RUBY_BINDINGS "Build Ruby bindings" ON)
-OPTION(BUILD_PYTHON2_BINDINGS "Build Python 2 bindings" ON)
+OPTION(BUILD_PYTHON3_BINDINGS "Build Python 3 bindings" ON)
OPTION(BUILD_PERL5_BINDINGS "Build Perl 5 bindings" ON)
#
@@ -26,10 +26,10 @@ IF(BUILD_RUBY_BINDINGS)
ENDIF()
ENDIF()
-IF(BUILD_PYTHON2_BINDINGS)
+IF(BUILD_PYTHON3_BINDINGS)
# Enforce Python 2.7, libzypp-bindings does not yet work with Python3
- set(PythonLibs_FIND_VERSION 2.7)
- set(PythonLibs_FIND_VERSION_MAJOR 2)
+ set(PythonLibs_FIND_VERSION 3.1)
+ set(PythonLibs_FIND_VERSION_MAJOR 3)
FIND_PACKAGE(PythonLibs)
IF(PYTHON_LIBRARY)
ADD_SUBDIRECTORY(python)
diff --git a/swig/python/CMakeLists.txt b/swig/python/CMakeLists.txt
index 284bcb0..3abf313 100644
--- a/swig/python/CMakeLists.txt
+++ b/swig/python/CMakeLists.txt
@@ -15,13 +15,13 @@ ADD_SUBDIRECTORY(tests)
SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libzypp_python.cc" )
FIND_PACKAGE(PythonInterp REQUIRED)
-IF (NOT PYTHON_SITEDIR)
- EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(1))" OUTPUT_VARIABLE PYTHON_SITEDIR)
-ENDIF (NOT PYTHON_SITEDIR)
+IF (NOT PYTHON3_SITEDIR)
+ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; import sysconfig; stdout.write(sysconfig.get_path('platlib'))" OUTPUT_VARIABLE PYTHON3_SITEDIR)
+ENDIF (NOT PYTHON3_SITEDIR)
MESSAGE(STATUS "Python executable: ${PYTHON_EXECUTABLE}")
MESSAGE(STATUS "Python include path: ${PYTHON_INCLUDE_PATH}")
-MESSAGE(STATUS "Python site dir: ${PYTHON_SITEDIR}")
+MESSAGE(STATUS "Python site dir: ${PYTHON3_SITEDIR}")
ADD_CUSTOM_COMMAND (
OUTPUT ${SWIG_OUTPUT}
@@ -44,5 +44,5 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/swig )
INCLUDE_DIRECTORIES( ${ZYPP_INCLUDE_DIR} )
TARGET_LINK_LIBRARIES( zypp_python ${ZYPP_LIBRARY} )
-INSTALL(TARGETS zypp_python LIBRARY DESTINATION ${PYTHON_SITEDIR})
-INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/zypp.py DESTINATION ${PYTHON_SITEDIR})
+INSTALL(TARGETS zypp_python LIBRARY DESTINATION ${PYTHON3_SITEDIR})
+INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/zypp.py DESTINATION ${PYTHON3_SITEDIR})
diff --git a/swig/python/tests/callbacks.py b/swig/python/tests/callbacks.py
index 4f446b7..35cf31d 100644
--- a/swig/python/tests/callbacks.py
+++ b/swig/python/tests/callbacks.py
@@ -7,17 +7,17 @@ import zypp
class CommitReceiver:
def removal_start(self, resolvable):
- print "Starting to remove ", resolvable.name()
+ print("Starting to remove ", resolvable.name())
def removal_progress(self, resolvable, percentage):
- print "Remove of ", resolvable.name(), " at ", percentage, "%"
+ print("Remove of ", resolvable.name(), " at ", percentage, "%")
return True
def removal_finish(self, resolvable, error, reason):
- print "Remove of ", resolvable.name(), " finished with problem ", error, ": ", reason
+ print("Remove of ", resolvable.name(), " finished with problem ", error, ": ", reason)
def removal_problem(self, resolvable, error, description):
- print "Remove of ", resolvable.name(), " has problem ", error, ": ", description
+ print("Remove of ", resolvable.name(), " has problem ", error, ": ", description)
return "ignore"
Z = zypp.ZYppFactory_instance().getZYpp()
@@ -30,25 +30,25 @@ commit_callbacks.connect(commit_receiver)
for item in Z.pool():
if item.resolvable().name() == "gedit":
- print "Emitting removal of ", item.resolvable().name()
+ print("Emitting removal of ", item.resolvable().name())
item.status().setToBeUninstalled(zypp.ResStatus.USER)
resolvable = item.resolvable()
if not Z.resolver().resolvePool():
- print "Problem count: %d" % Z.resolver().problems().size()
+ print("Problem count: %d" % Z.resolver().problems().size())
policy = zypp.ZYppCommitPolicy()
policy.downloadMode(zypp.DownloadInAdvance)
policy.dryRun( False )
policy.syncPoolAfterCommit( False )
- print "Committing"
+ print("Committing")
try:
result = Z.commit( policy )
- print "Done:", result
+ print("Done:", result)
except:
- print "Oops"
+ print("Oops")
break
# raise
-print "disconnecting"
+print("disconnecting")
commit_callbacks.disconnect()
-print "disconnected"
+print("disconnected")
diff --git a/swig/python/tests/commit_callbacks.py b/swig/python/tests/commit_callbacks.py
index 24a1ff3..7003a24 100644
--- a/swig/python/tests/commit_callbacks.py
+++ b/swig/python/tests/commit_callbacks.py
@@ -77,7 +77,7 @@ class CommitReceiver:
# testing: increment the number of removals and print the resolvable
global removals
removals += 1
- print "Starting to remove ", resolvable
+ print("Starting to remove ", resolvable)
#
# removal_progress() is called during a resolvable (typically package) uninstall
@@ -86,7 +86,7 @@ class CommitReceiver:
#
def removal_progress(self, resolvable, percentage):
assert percentage == 42
- print "Remove of ", resolvable, " at ", percentage, "%"
+ print("Remove of ", resolvable, " at ", percentage, "%")
return True
#
@@ -99,7 +99,7 @@ class CommitReceiver:
# - "invalid": any other error
#
def removal_finish(self, resolvable, status, detail):
- print "Remove of ", resolvable.name(), " finished with problem ", status, ": ", detail
+ print("Remove of ", resolvable.name(), " finished with problem ", status, ": ", detail)
#
# report a problem during resolvable removal
@@ -108,7 +108,7 @@ class CommitReceiver:
# Must return "abort", "retry" or "ignore"
#
def removal_problem(self, resolvable, error, description):
- print "Remove of ", resolvable.name(), " has problem ", error, ": ", description
+ print("Remove of ", resolvable.name(), " has problem ", error, ": ", description)
return "ignore"
################################
@@ -122,7 +122,7 @@ class CommitReceiver:
# testing: increment the number of removals and print the resolvable
global installs
installs += 1
- print "Starting to install ", resolvable
+ print("Starting to install ", resolvable)
#
# install_progress() is called during a resolvable (typically package) install
@@ -131,7 +131,7 @@ class CommitReceiver:
#
def install_progress(self, resolvable, percentage):
assert percentage == 42
- print "Install of ", resolvable, " at ", percentage, "%"
+ print("Install of ", resolvable, " at ", percentage, "%")
return True
#
@@ -144,7 +144,7 @@ class CommitReceiver:
# - "invalid": any other error
#
def install_finish(self, resolvable, status, detail):
- print "Install of ", resolvable.name(), " finished with problem ", status, ": ", detail
+ print("Install of ", resolvable.name(), " finished with problem ", status, ": ", detail)
#
# report a problem during resolvable install
@@ -153,7 +153,7 @@ class CommitReceiver:
# Must return "abort", "retry" or "ignore"
#
def install_problem(self, resolvable, error, description):
- print "Install of ", resolvable.name(), " has problem ", error, ": ", description
+ print("Install of ", resolvable.name(), " has problem ", error, ": ", description)
return "ignore"
#
@@ -232,7 +232,7 @@ class CommitCallbacksTestCase(unittest.TestCase):
# Loop over pool - just to get real instances of Resolvable
#
for item in self.Z.pool():
- print "Emitting removal of ", item.resolvable()
+ print("Emitting removal of ", item.resolvable())
#
# Use the zypp.CommitCallbacksEmitter to fake an actual package removal
#
@@ -254,7 +254,7 @@ class CommitCallbacksTestCase(unittest.TestCase):
# Loop over pool - just to get real instances of Resolvable
#
for item in self.Z.pool():
- print "Emitting install of ", item.resolvable()
+ print("Emitting install of ", item.resolvable())
#
# Use the zypp.CommitCallbacksEmitter to fake an actual package removal
#
diff --git a/swig/python/tests/installed_path.py b/swig/python/tests/installed_path.py
index 95cecd7..223bb43 100644
--- a/swig/python/tests/installed_path.py
+++ b/swig/python/tests/installed_path.py
@@ -17,10 +17,10 @@ class TestSequenceFunctions(unittest.TestCase):
installed_pkgs = Z.pool()
for item in installed_pkgs:
if zypp.isKindPackage(item):
- print "Repopath %s" % item.repoInfo().packagesPath()
+ print("Repopath %s" % item.repoInfo().packagesPath())
item = zypp.asKindPackage(item)
- print "Location filename %s" % item.location().filename()
- print "%s.%s %s:%d" % (item.name(), item.arch(), item.edition(), item.installSize())
+ print("Location filename %s" % item.location().filename())
+ print("%s.%s %s:%d" % (item.name(), item.arch(), item.edition(), item.installSize()))
if __name__ == '__main__':
diff --git a/swig/python/tests/problems.py b/swig/python/tests/problems.py
index 0406290..3056884 100644
--- a/swig/python/tests/problems.py
+++ b/swig/python/tests/problems.py
@@ -14,7 +14,7 @@ class TestSequenceFunctions(unittest.TestCase):
assert Z
if not Z.resolver().resolvePool():
for problem in Z.resolver().problems():
- print "Problem %s" % problem.description()
+ print("Problem %s" % problem.description())
# raise "Solver Error"
if __name__ == '__main__':