summaryrefslogtreecommitdiff
path: root/scanner.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 /scanner.py
parent54cb146e541b557471a19fcd884abd7e441d85b8 (diff)
downloadruamel.yaml-3d77f16e00124b74e150625396617b41e41da014.tar.gz
removed (object), prepare new RTScanner
Diffstat (limited to 'scanner.py')
-rw-r--r--scanner.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/scanner.py b/scanner.py
index 547af3c..f98da00 100644
--- a/scanner.py
+++ b/scanner.py
@@ -28,9 +28,10 @@
# Read comments in the Scanner code for more details.
#
-from ruamel.yaml.error import MarkedYAMLError
+import inspect
+from ruamel.yaml.error import MarkedYAMLError, CommentMark
from ruamel.yaml.tokens import * # NOQA
-from ruamel.yaml.compat import _F, check_anchorname_char, nprint # NOQA
+from ruamel.yaml.compat import _F, check_anchorname_char, nprint, nprintf # NOQA
if False: # MYPY
from typing import Any, Dict, Optional, List, Union, Text # NOQA
@@ -48,7 +49,7 @@ class ScannerError(MarkedYAMLError):
pass
-class SimpleKey(object):
+class SimpleKey:
# See below simple keys treatment.
def __init__(self, token_number, required, index, line, column, mark):
@@ -61,7 +62,7 @@ class SimpleKey(object):
self.mark = mark
-class Scanner(object):
+class Scanner:
def __init__(self, loader=None):
# type: (Any) -> None
"""Initialize the scanner."""
@@ -1972,10 +1973,3 @@ class RoundTripScanner(Scanner):
def scan_block_scalar(self, style, rt=True):
# type: (Any, Optional[bool]) -> Any
return Scanner.scan_block_scalar(self, style, rt=rt)
-
-
-# try:
-# import psyco
-# psyco.bind(Scanner)
-# except ImportError:
-# pass