Skip to content

Commit

Permalink
Improve with_unicode
Browse files Browse the repository at this point in the history
Some time ago `with_unicode` was improved in Oscar, apply that here.
  • Loading branch information
fingolfin committed Nov 5, 2023
1 parent 8e35f2d commit 4c0e0f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/AbstractAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import GroupsCore
import GroupsCore: gens, ngens, order, mul!, istrivial

# A list of all symbols external packages should not import from AbstractAlgebra
import_exclude = [:import_exclude, :QQ, :ZZ,
const import_exclude = [:import_exclude, :QQ, :ZZ,
:RealField, :number_field,
:AbstractAlgebra,
:inv, :log, :exp, :sqrt, :div, :divrem,
Expand Down
9 changes: 6 additions & 3 deletions src/PrettyPrinting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1398,9 +1398,12 @@ function is_unicode_allowed()
end

function with_unicode(f::Function)
old_allow_unicode = allow_unicode(true);
f()
allow_unicode(old_allow_unicode);
old_allow_unicode = allow_unicode(true)
try
f()

Check warning on line 1403 in src/PrettyPrinting.jl

View check run for this annotation

Codecov / codecov/patch

src/PrettyPrinting.jl#L1401-L1403

Added lines #L1401 - L1403 were not covered by tests
finally
allow_unicode(old_allow_unicode)

Check warning on line 1405 in src/PrettyPrinting.jl

View check run for this annotation

Codecov / codecov/patch

src/PrettyPrinting.jl#L1405

Added line #L1405 was not covered by tests
end
end

################################################################################
Expand Down

0 comments on commit 4c0e0f1

Please sign in to comment.