Skip to content

Commit

Permalink
Fix 'Protocols cannot be instantiated' with Python 3.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
elarivie committed Sep 6, 2021
1 parent 5569662 commit 516eb0f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 45 deletions.
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [Released] - 1.0.9 2021-09-05

### Fixed

- Fix error *Protocols cannot be instantiated*, occurring with Python 3.9.7

## [Released] - 1.0.8 2021-01-27

## Added
### Added

- rwlock_async (Thanks to Mike Merrill)
- Support for python 3.9
Expand All @@ -19,7 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Released] - 1.0.7 2020-04-26

## Added
### Added

- Code coverage badge to README.md using [codecov](https://codecov.io)
- Download count related badges to README.md
Expand All @@ -40,12 +46,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Released] - 1.0.6 2020-01-14

## Fixed
### Fixed
- Add missing runtime dependency 'typing_extensions' to setup.py

## [Released] - 1.0.5 2020-01-14

## Fixed
### Fixed
- README.rst is now included in source tar

### Changed
Expand All @@ -54,7 +60,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Released] - 1.0.4 2019-06-29


### Removed
- Python 3.4 from the list of supported python version

Expand Down
2 changes: 1 addition & 1 deletion HEARTBEAT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021-01
2021-09
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Reader Writer Lock
==================

**A python implementation of the three Reader-Writer problems.**
**A python implementation of a solution for the three Reader-Writer problems.**

[![repo status Active](https://www.repostatus.org/badges/latest/active.svg "repo status Active")](https://www.repostatus.org/#active)
[![Build Status](https://travis-ci.org/elarivie/pyReaderWriterLock.svg?branch=master)](https://travis-ci.org/elarivie/pyReaderWriterLock)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.8
1.0.9
18 changes: 0 additions & 18 deletions readerwriterlock/rwlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,11 @@ def __init__(self, lock_factory: Callable[[], Lockable] = threading.Lock, time_s
self.c_time_source = time_source
self.c_resource = lock_factory()
self.c_lock_read_count = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockRead") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -166,7 +164,6 @@ class _aWriter(Lockable):
def __init__(self, p_RWLock: "RWLockRead") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -206,13 +203,11 @@ def __init__(self, lock_factory: Callable[[], Lockable] = threading.Lock, time_s
self.c_lock_read_entry = lock_factory()
self.c_lock_read_try = lock_factory()
self.c_resource = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockWrite") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -259,7 +254,6 @@ class _aWriter(Lockable):
def __init__(self, p_RWLock: "RWLockWrite") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -318,13 +312,11 @@ def __init__(self, lock_factory: Callable[[], Lockable] = threading.Lock, time_s
self.c_lock_read_count = lock_factory()
self.c_lock_read = lock_factory()
self.c_lock_write = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockFair") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -365,7 +357,6 @@ class _aWriter(Lockable):
def __init__(self, p_RWLock: "RWLockFair") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -408,13 +399,11 @@ def __init__(self, lock_factory: Callable[[], Lockable] = threading.Lock, time_s
self.c_time_source = time_source
self.c_resource = lock_factory()
self.c_lock_read_count = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockReadD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -450,7 +439,6 @@ class _aWriter(LockableD):
def __init__(self, p_RWLock: "RWLockReadD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -515,13 +503,11 @@ def __init__(self, lock_factory: Callable[[], Lockable] = threading.Lock, time_s
self.c_lock_read_entry = lock_factory()
self.c_lock_read_try = lock_factory()
self.c_resource = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockWriteD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -568,7 +554,6 @@ class _aWriter(LockableD):
def __init__(self, p_RWLock: "RWLockWriteD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -643,13 +628,11 @@ def __init__(self, lock_factory: Callable[[], Lockable] = threading.Lock, time_s
self.c_lock_read_count = lock_factory()
self.c_lock_read = lock_factory()
self.c_lock_write = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockFairD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -690,7 +673,6 @@ class _aWriter(LockableD):
def __init__(self, p_RWLock: "RWLockFairD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down
18 changes: 0 additions & 18 deletions readerwriterlock/rwlock_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,11 @@ def __init__(self, lock_factory: Union[Callable[[], Lockable], Type[asyncio.Lock
self.c_time_source = time_source
self.c_resource = lock_factory()
self.c_lock_read_count = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockRead") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -176,7 +174,6 @@ class _aWriter(Lockable):
def __init__(self, p_RWLock: "RWLockRead") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -222,13 +219,11 @@ def __init__(self, lock_factory: Union[Callable[[], Lockable], Type[asyncio.Lock
self.c_lock_read_entry = lock_factory()
self.c_lock_read_try = lock_factory()
self.c_resource = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockWrite") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -283,7 +278,6 @@ class _aWriter(Lockable):
def __init__(self, p_RWLock: "RWLockWrite") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -348,13 +342,11 @@ def __init__(self, lock_factory: Union[Callable[[], Lockable], Type[asyncio.Lock
self.c_lock_read_count = lock_factory()
self.c_lock_read = lock_factory()
self.c_lock_write = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockFair") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -401,7 +393,6 @@ class _aWriter(Lockable):
def __init__(self, p_RWLock: "RWLockFair") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -448,13 +439,11 @@ def __init__(self, lock_factory: Union[Callable[[], Lockable], Type[asyncio.Lock
self.c_time_source = time_source
self.c_resource = lock_factory()
self.c_lock_read_count = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockReadD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -494,7 +483,6 @@ class _aWriter(LockableD):
def __init__(self, p_RWLock: "RWLockReadD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -567,13 +555,11 @@ def __init__(self, lock_factory: Union[Callable[[], Lockable], Type[asyncio.Lock
self.c_lock_read_entry = lock_factory()
self.c_lock_read_try = lock_factory()
self.c_resource = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockWriteD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -628,7 +614,6 @@ class _aWriter(LockableD):
def __init__(self, p_RWLock: "RWLockWriteD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -709,13 +694,11 @@ def __init__(self, lock_factory: Union[Callable[[], Lockable], Type[asyncio.Lock
self.c_lock_read_count = lock_factory()
self.c_lock_read = lock_factory()
self.c_lock_write = lock_factory()
super().__init__()

class _aReader(Lockable):
def __init__(self, p_RWLock: "RWLockFairD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down Expand Up @@ -762,7 +745,6 @@ class _aWriter(LockableD):
def __init__(self, p_RWLock: "RWLockFairD") -> None:
self.c_rw_lock = p_RWLock
self.v_locked: bool = False
super().__init__()

async def acquire(self, blocking: bool = True, timeout: float = -1) -> bool:
"""Acquire a lock."""
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ disable =
unsubscriptable-object,
invalid-name,
bad-continuation,
duplicate-code
duplicate-code,
super-init-not-called
indent-string='\t'
include-naming-hint=yes
overgeneral-exceptions=Exception

0 comments on commit 516eb0f

Please sign in to comment.