Skip to content

Commit

Permalink
ENH Add support for Python 3.12
Browse files Browse the repository at this point in the history
imp module has been removed
  • Loading branch information
luispedro committed Nov 5, 2023
1 parent 4bc4324 commit 4fad766
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
- '3.12'

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Unreleased
* jug: update for Python 3.12

Version 2.3.0 Tue 25 June 2023 by luispedro
* jug shell: Add `get_filtered_tasks()`
* jug: Fix `jug --version` (which had been broken in the refactoring to
Expand Down
4 changes: 2 additions & 2 deletions jug/jug.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def init(jugfile=None, jugdir=None, on_error='exit', store=None):
store : storage object
jugspace : dictionary
'''
import imp
import types
from .options import set_jugdir
assert on_error in ('exit', 'propagate'), 'jug.init: on_error option is not valid.'

Expand All @@ -93,7 +93,7 @@ def init(jugfile=None, jugdir=None, on_error='exit', store=None):
# if BarrierError is raised.
#
jugmodname = os.path.basename(jugfile[:-len('.py')])
jugmodule = imp.new_module(jugmodname)
jugmodule = types.ModuleType(jugmodname)
jugmodule.__file__ = os.path.abspath(jugfile)
jugspace = jugmodule.__dict__
sys.modules[jugmodname] = jugmodule
Expand Down

0 comments on commit 4fad766

Please sign in to comment.