Skip to content

Commit

Permalink
Fix Quantity & Unit is_compatible_with with registry active contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
jules-ch committed Nov 24, 2021
1 parent 5bdf010 commit 9ccee33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Pint Changelog

- Upgrade min version of uncertainties to 3.1.4
- Fix setting options of the application registry (Issue #1403).
- Fix Quantity & Unit `is_compatible_with` with registry active contexts (Issue #1424).


0.18 (2021-10-26)
Expand Down
2 changes: 1 addition & 1 deletion pint/quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def is_compatible_with(
-------
bool
"""
if contexts:
if contexts or self._REGISTRY._active_ctx:
try:
self.to(other, *contexts, **ctx_kwargs)
return True
Expand Down
2 changes: 1 addition & 1 deletion pint/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def is_compatible_with(
-------
bool
"""
if contexts:
if contexts or self._REGISTRY._active_ctx:
try:
(1 * self).to(other, *contexts, **ctx_kwargs)
return True
Expand Down

0 comments on commit 9ccee33

Please sign in to comment.