typedparser 0.10.7__tar.gz → 0.10.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: typedparser
3
- Version: 0.10.7
3
+ Version: 0.10.8
4
4
  Summary: Extension for python argparse with typehints and typechecks.
5
5
  Author: simon-ging
6
6
  License: Apache-2.0
@@ -181,7 +181,7 @@ Note: Some tests are skipped for python 3.7.
181
181
 
182
182
  ~~~bash
183
183
  pip install -e .
184
- pip install pytest pytest-cov pylint pytest-lazy-fixture
184
+ pip install pytest pytest-cov pylint
185
185
  pylint typedparser
186
186
 
187
187
  # run tests
@@ -154,7 +154,7 @@ Note: Some tests are skipped for python 3.7.
154
154
 
155
155
  ~~~bash
156
156
  pip install -e .
157
- pip install pytest pytest-cov pylint pytest-lazy-fixture
157
+ pip install pytest pytest-cov pylint
158
158
  pylint typedparser
159
159
 
160
160
  # run tests
@@ -28,5 +28,5 @@ def define(*args, **kwargs):
28
28
  )
29
29
 
30
30
 
31
- __version__ = "0.10.7"
31
+ __version__ = "0.10.8"
32
32
 
@@ -22,7 +22,11 @@ from typing import (
22
22
  )
23
23
 
24
24
  from .objects import check_object_equality, RecursorInterface, StrictRecursor, AttrsClass
25
- from types import UnionType
25
+
26
+ try:
27
+ from types import UnionType
28
+ except ImportError:
29
+ UnionType = None
26
30
 
27
31
  try:
28
32
  # python>=3.8
@@ -314,7 +318,7 @@ def _parse_nested(
314
318
  return value
315
319
 
316
320
  # resolve unions (mostly "optional")
317
- if origin == Union or isinstance(typ, UnionType):
321
+ if origin == Union or (UnionType is not None and isinstance(typ, UnionType)):
318
322
  for new_typ in args:
319
323
  try:
320
324
  # force strict parsing and catch errors to try all different types
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: typedparser
3
- Version: 0.10.7
3
+ Version: 0.10.8
4
4
  Summary: Extension for python argparse with typehints and typechecks.
5
5
  Author: simon-ging
6
6
  License: Apache-2.0
@@ -181,7 +181,7 @@ Note: Some tests are skipped for python 3.7.
181
181
 
182
182
  ~~~bash
183
183
  pip install -e .
184
- pip install pytest pytest-cov pylint pytest-lazy-fixture
184
+ pip install pytest pytest-cov pylint
185
185
  pylint typedparser
186
186
 
187
187
  # run tests
File without changes
File without changes