Skip to content

Commit c180980

Browse files
authored
Remove no longer necessary code (#902)
1 parent 099bb09 commit c180980

3 files changed

Lines changed: 0 additions & 17 deletions

File tree

jsonargparse/_core.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
NSKeyError,
5757
get_non_meta_sorted_keys,
5858
is_meta_key,
59-
patch_namespace,
6059
recreate_branches,
6160
remove_meta,
6261
split_key_leaf,
@@ -289,7 +288,6 @@ def _parse_known_args_internal(self, args=None, namespace=None, *, argcomplete:
289288
namespace = get_argcomplete_namespace(self, namespace)
290289
try:
291290
with (
292-
patch_namespace(),
293291
parser_context(parent_parser=self, lenient_check=True),
294292
ActionTypeHint.subclass_arg_context(self),
295293
suppress_required_actions(self),

jsonargparse/_deprecated.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,6 @@ def __call__(self, absolute: bool = True) -> str:
525525
return self._absolute if absolute else self._relative
526526

527527

528-
class DebugException(Exception):
529-
pass
530-
531-
532528
@deprecated("""
533529
usage_and_exit_error_handler was deprecated in v4.20.0 and will be removed
534530
in v5.0.0. With the removal of error_handler, there is no longer a need for

jsonargparse/_namespace.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import argparse
44
from collections import OrderedDict
55
from collections.abc import Iterator
6-
from contextlib import contextmanager
76
from typing import Any, Optional, Union
87

98
__all__ = ["Namespace"]
@@ -52,16 +51,6 @@ def recreate_branches(data, skip_keys=None):
5251
return new_data
5352

5453

55-
@contextmanager
56-
def patch_namespace():
57-
namespace_class = argparse.Namespace
58-
argparse.Namespace = Namespace
59-
try:
60-
yield
61-
finally:
62-
argparse.Namespace = namespace_class
63-
64-
6554
class Namespace(argparse.Namespace):
6655
"""Extension of argparse's Namespace to support nesting and subscript access."""
6756

0 commit comments

Comments
 (0)