Skip to content

Commit

Permalink
Merge pull request #1 from aebrahim/add_more_py_versions
Browse files Browse the repository at this point in the history
Add support for python 3.8 and 3.9.
  • Loading branch information
aebrahim authored Sep 5, 2023
2 parents a00acc3 + 0353e5c commit aeee693
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
python-version: ["3.10", "3.11", "3.12-dev", "pypy3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev", "pypy3.10", "pypy3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
3 changes: 2 additions & 1 deletion once.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def __get__(self, obj, cls):
func = functools.partial(self.func.__func__, cls)
return functools.partial(self._execute_call_once, func)
if isinstance(self.func, staticmethod):
return functools.partial(self._execute_call_once, self.func)
# The additional __func__ is required for python <= 3.9
return functools.partial(self._execute_call_once, self.func.__func__)
return functools.partial(self._execute_call_once, self.func, obj)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ authors = [
description = "Utility for initialization ensuring functions are called only once"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
Expand Down

0 comments on commit aeee693

Please sign in to comment.