Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 52887:346d2c04440a
util: mark `transactional` as an ABC in a more convention manner
Not sure if this was a py2 legacy holdover, but we'll see if this unconfuses
pytype.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 20 Dec 2024 19:13:06 -0500 |
parents | 4eede65d68cf |
children | 7a6fc0e2a89a |
comparison
equal
deleted
inserted
replaced
52886:e6069f84abbb | 52887:346d2c04440a |
---|---|
1414 | 1414 |
1415 Be sure to call d = d.preparewrite() before writing to d. | 1415 Be sure to call d = d.preparewrite() before writing to d. |
1416 """ | 1416 """ |
1417 | 1417 |
1418 | 1418 |
1419 class transactional: # pytype: disable=ignored-metaclass | 1419 class transactional(abc.ABC): |
1420 """Base class for making a transactional type into a context manager.""" | 1420 """Base class for making a transactional type into a context manager.""" |
1421 | |
1422 __metaclass__ = abc.ABCMeta | |
1423 | 1421 |
1424 @abc.abstractmethod | 1422 @abc.abstractmethod |
1425 def close(self): | 1423 def close(self): |
1426 """Successfully closes the transaction.""" | 1424 """Successfully closes the transaction.""" |
1427 | 1425 |