Skip to content

Commit df7a47c

Browse files
committed
2 parents 343f952 + ba1cc50 commit df7a47c

File tree

15 files changed

+159
-204
lines changed

15 files changed

+159
-204
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -xuo pipefail
33

44
DOCKER_IMAGE=jmadler/python-future-builder
55
# XXX: TODO: Perhaps this version shouldn't be hardcoded
6-
version=0.18.3
6+
version=0.18.4
77

88
docker build . -t $DOCKER_IMAGE
99
docker push $DOCKER_IMAGE:latest

docs/whatsnew.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
What's New
44
**********
55

6+
What's new in version 0.18.4 (2023-10-10)
7+
=========================================
8+
This is a minor bug-fix release containing a number of fixes:
9+
10+
- Fix for Python 3.12's removal of the imp module
11+
612
What's new in version 0.18.3 (2023-01-13)
713
=========================================
814
This is a minor bug-fix release containing a number of fixes:

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@
103103
"Programming Language :: Python :: 3.5",
104104
"Programming Language :: Python :: 3.6",
105105
"Programming Language :: Python :: 3.7",
106+
"Programming Language :: Python :: 3.8",
107+
"Programming Language :: Python :: 3.9",
108+
"Programming Language :: Python :: 3.10",
109+
"Programming Language :: Python :: 3.11",
110+
"Programming Language :: Python :: 3.12",
106111
"License :: OSI Approved",
107112
"License :: OSI Approved :: MIT License",
108113
"Development Status :: 4 - Beta",

src/future/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
__copyright__ = 'Copyright 2013-2019 Python Charmers Pty Ltd'
8888
__ver_major__ = 0
8989
__ver_minor__ = 18
90-
__ver_patch__ = 3
90+
__ver_patch__ = 4
9191
__ver_sub__ = ''
9292
__version__ = "%d.%d.%d%s" % (__ver_major__, __ver_minor__,
9393
__ver_patch__, __ver_sub__)

src/future/backports/test/support.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
# import collections.abc # not present on Py2.7
2929
import re
3030
import subprocess
31-
import imp
3231
import time
3332
try:
3433
import sysconfig
@@ -341,37 +340,6 @@ def rmtree(path):
341340
if error.errno != errno.ENOENT:
342341
raise
343342

344-
def make_legacy_pyc(source):
345-
"""Move a PEP 3147 pyc/pyo file to its legacy pyc/pyo location.
346-
347-
The choice of .pyc or .pyo extension is done based on the __debug__ flag
348-
value.
349-
350-
:param source: The file system path to the source file. The source file
351-
does not need to exist, however the PEP 3147 pyc file must exist.
352-
:return: The file system path to the legacy pyc file.
353-
"""
354-
pyc_file = imp.cache_from_source(source)
355-
up_one = os.path.dirname(os.path.abspath(source))
356-
legacy_pyc = os.path.join(up_one, source + ('c' if __debug__ else 'o'))
357-
os.rename(pyc_file, legacy_pyc)
358-
return legacy_pyc
359-
360-
def forget(modname):
361-
"""'Forget' a module was ever imported.
362-
363-
This removes the module from sys.modules and deletes any PEP 3147 or
364-
legacy .pyc and .pyo files.
365-
"""
366-
unload(modname)
367-
for dirname in sys.path:
368-
source = os.path.join(dirname, modname + '.py')
369-
# It doesn't matter if they exist or not, unlink all possible
370-
# combinations of PEP 3147 and legacy pyc and pyo files.
371-
unlink(source + 'c')
372-
unlink(source + 'o')
373-
unlink(imp.cache_from_source(source, debug_override=True))
374-
unlink(imp.cache_from_source(source, debug_override=False))
375343

376344
# On some platforms, should not run gui test even if it is allowed
377345
# in `use_resources'.

src/future/moves/test/support.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
from __future__ import absolute_import
2+
3+
import sys
4+
25
from future.standard_library import suspend_hooks
36
from future.utils import PY3
47

58
if PY3:
69
from test.support import *
10+
if sys.version_info[:2] >= (3, 10):
11+
from test.support.os_helper import (
12+
EnvironmentVarGuard,
13+
TESTFN,
14+
)
15+
from test.support.warnings_helper import check_warnings
716
else:
817
__future_module__ = True
918
with suspend_hooks():

src/future/standard_library/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@
6262

6363
import sys
6464
import logging
65-
import imp
6665
import contextlib
67-
import types
6866
import copy
6967
import os
7068

@@ -79,6 +77,9 @@
7977

8078
from future.utils import PY2, PY3
8179

80+
if PY2:
81+
import imp
82+
8283
# The modules that are defined under the same names on Py3 but with
8384
# different contents in a significant way (e.g. submodules) are:
8485
# pickle (fast one)

0 commit comments

Comments
 (0)