diff --git a/bindings/python/fdb/impl.py b/bindings/python/fdb/impl.py index 58acec1150..3dd5e87077 100644 --- a/bindings/python/fdb/impl.py +++ b/bindings/python/fdb/impl.py @@ -253,9 +253,9 @@ def transactional(*tr_args, **tr_kwargs): @functools.wraps(func) def wrapper(*args, **kwargs): # We can't throw this from the decorator, as when a user runs - # >>> import fdb ; fdb.api_version(700) + # >>> import fdb ; fdb.api_version(630) # the code above uses @transactional before the API version is set - if fdb.get_api_version() >= 700 and inspect.isgeneratorfunction(func): + if fdb.get_api_version() >= 630 and inspect.isgeneratorfunction(func): raise ValueError("Generators can not be wrapped with fdb.transactional") if isinstance(args[index], TransactionRead): @@ -273,7 +273,7 @@ def transactional(*tr_args, **tr_kwargs): ret = None try: ret = func(*largs, **kwargs) - if fdb.get_api_version() >= 700 and inspect.isgenerator(ret): + if fdb.get_api_version() >= 630 and inspect.isgenerator(ret): raise ValueError("Generators can not be wrapped with fdb.transactional") tr.commit().wait() committed = True diff --git a/bindings/python/tests/tester.py b/bindings/python/tests/tester.py index bb564a188f..a2ae66dde6 100644 --- a/bindings/python/tests/tester.py +++ b/bindings/python/tests/tester.py @@ -132,9 +132,9 @@ def test_fdb_transactional_generator(db): @fdb.transactional def function_that_yields(tr): yield 0 - assert fdb.get_api_version() < 700, "Pre-7.0, a decorators may wrap a function that yield" + assert fdb.get_api_version() < 630, "Pre-6.3, a decorators may wrap a function that yield" except ValueError as e: - assert fdb.get_api_version() >= 700, "Post-7.0, a decorator should throw if wrapped function yields" + assert fdb.get_api_version() >= 630, "Post-6.3, a decorator should throw if wrapped function yields" def test_fdb_transactional_returns_generator(db): @@ -145,9 +145,9 @@ def test_fdb_transactional_returns_generator(db): def function_that_returns(tr): return function_that_yields(tr) function_that_returns() - assert fdb.get_api_version() < 700, "Pre-7.0, returning a generator is allowed" + assert fdb.get_api_version() < 630, "Pre-6.3, returning a generator is allowed" except ValueError as e: - assert fdb.get_api_version() >= 700, "Post-7.0, returning a generator should throw" + assert fdb.get_api_version() >= 630, "Post-6.3, returning a generator should throw" def test_db_options(db):