summaryrefslogtreecommitdiff
path: root/compat.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2021-04-19 08:17:05 +0200
committerAnthon van der Neut <anthon@mnt.org>2021-04-19 08:17:05 +0200
commit3d77f16e00124b74e150625396617b41e41da014 (patch)
treeed01337ba7c78a5a5e68255a7a574e00e78556fc /compat.py
parent54cb146e541b557471a19fcd884abd7e441d85b8 (diff)
downloadruamel.yaml-3d77f16e00124b74e150625396617b41e41da014.tar.gz
removed (object), prepare new RTScanner
Diffstat (limited to 'compat.py')
-rw-r--r--compat.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/compat.py b/compat.py
index 7a419dc..10ebc23 100644
--- a/compat.py
+++ b/compat.py
@@ -95,7 +95,7 @@ if 'RUAMELDEBUG' in os.environ:
if bool(_debug):
- class ObjectCounter(object):
+ class ObjectCounter:
def __init__(self):
# type: () -> None
self.map = {} # type: Dict[Any, Any]
@@ -128,7 +128,7 @@ def dbg(val=None):
return _debug & val
-class Nprint(object):
+class Nprint:
def __init__(self, file_name=None):
# type: (Any) -> None
self._max_print = None # type: Any
@@ -162,6 +162,9 @@ class Nprint(object):
self._max_print = i
self._count = None
+ def fp(self, mode='a'):
+ out = sys.stdout if self._file_name is None else open(self._file_name, mode)
+ return out
nprint = Nprint()
nprintf = Nprint('/var/tmp/ruamel.yaml.log')