ref: refs/heads/master
commit ce71cc735c6faddeb4fa343ac72be63211ba666d
Author: Klaus Kämpf
Date: Tue Mar 17 21:04:31 2009 +0100
Let the Python binding return a bool from Solver.solve() as described in
the documentation.
---
bindings/python/tests/solvable.py | 5 +++--
bindings/solver.i | 5 +++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/bindings/python/tests/solvable.py b/bindings/python/tests/solvable.py
index 4014b74..def7350 100644
--- a/bindings/python/tests/solvable.py
+++ b/bindings/python/tests/solvable.py
@@ -86,9 +86,10 @@ class TestSequenceFunctions(unittest.TestCase):
transaction.install( solv1 )
self.pool.installed = self.pool.create_repo( "system" )
- solver = self.pool.create_solver( )
+ solver = self.pool.create_solver()
# self.pool.debug = 255
- solver.solve( transaction )
+ res = solver.solve( transaction )
+ assert res.__class__.__name__ == 'bool', res.__class__.__name__
# solver.each_to_install { |s|
# puts "Install #{s}"
# }
diff --git a/bindings/solver.i b/bindings/solver.i
index 768793d..ea9c3c3 100644
--- a/bindings/solver.i
+++ b/bindings/solver.i
@@ -785,6 +785,11 @@ typedef struct solver {} Solver;
%typemap(out) int solve
"$result = $1 ? Qtrue : Qfalse;";
#endif
+#if defined(SWIGPYTHON)
+%typemap(out) int solve {
+ $result = PyBool_FromLong((long) ($1 ? 1 : 0));
+}
+#endif
/*
* Solve the given Transaction
*
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org