Skip to content

Commit 8339ae3

Browse files
committed
0.15: drop support for old raisef call signature
Please use as `raisef(exc)` or `raisef(exc, cause=...)`. These correspond exactly to `raise exc` and `raise exc from ...`, respectively. Resolves #30.
1 parent f804063 commit 8339ae3

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

unpythonic/misc.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def applyfrozenargsto(f):
214214
return maybe_force_args(force(f), *args, **kwargs)
215215
return applyfrozenargsto
216216

217-
def raisef(exc, *args, cause=None, **kwargs):
217+
def raisef(exc, *, cause=None):
218218
"""``raise`` as a function, to make it possible for lambdas to raise exceptions.
219219
220220
Example::
@@ -235,23 +235,7 @@ def raisef(exc, *args, cause=None, **kwargs):
235235
If `exc` was triggered as a direct consequence of another exception,
236236
and you would like to `raise ... from ...`, pass that other exception
237237
instance as `cause`. The default `None` performs a plain `raise ...`.
238-
239-
*Changed in v0.14.2.* The parameters have changed to match `raise` itself as closely
240-
as possible. Old-style parameters are still supported, but are now deprecated. Support
241-
for them will be dropped in v0.15.0. The old-style parameters are:
242-
243-
exc: type
244-
The object type to raise as an exception.
245-
246-
*args: anything
247-
Passed on to the constructor of exc.
248-
249-
**kwargs: anything
250-
Passed on to the constructor of exc.
251238
"""
252-
if args or kwargs: # old-style parameters
253-
raise exc(*args, **kwargs)
254-
255239
if cause:
256240
raise exc from cause
257241
else:

0 commit comments

Comments
 (0)