Skip to content

Commit

Permalink
ozutil: collections -> collections.abc
Browse files Browse the repository at this point in the history
For python 3.10, some items formerly from collections must now be
obtained from collections.abc.  This should be backwards compatible.
https://docs.python.org/3.5/library/collections.abc.html#collections.abc.Callable
  • Loading branch information
dbungert committed Feb 7, 2022
1 parent 4a5dbb2 commit 2f81e48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oz/ozutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Miscellaneous utility functions.
"""

import collections
import collections.abc
try:
import configparser
except ImportError:
Expand Down Expand Up @@ -536,7 +536,7 @@ def copy_modify_file(inname, outname, subfunc):
raise Exception("output filename is None")
if subfunc is None:
raise Exception("subfunction is None")
if not isinstance(subfunc, collections.Callable):
if not isinstance(subfunc, collections.abc.Callable):
raise Exception("subfunction is not callable")

infile = open(inname, 'r')
Expand Down

0 comments on commit 2f81e48

Please sign in to comment.