mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-06 12:54:29 +08:00
Remove some weird code
This commit is contained in:
@@ -14,14 +14,6 @@ except NameError:
|
|||||||
is_pypy = platform.python_implementation() == 'PyPy'
|
is_pypy = platform.python_implementation() == 'PyPy'
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
encoding = sys.stdout.encoding
|
|
||||||
if encoding is None:
|
|
||||||
encoding = 'utf-8'
|
|
||||||
except AttributeError:
|
|
||||||
encoding = 'ascii'
|
|
||||||
|
|
||||||
|
|
||||||
def u(string):
|
def u(string):
|
||||||
"""Cast to unicode DAMMIT!
|
"""Cast to unicode DAMMIT!
|
||||||
Written because Python2 repr always implicitly casts to a string, so we
|
Written because Python2 repr always implicitly casts to a string, so we
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import sys
|
import sys
|
||||||
from abc import abstractmethod, abstractproperty
|
from abc import abstractmethod, abstractproperty
|
||||||
|
|
||||||
from parso._compatibility import encoding
|
|
||||||
from parso.utils import split_lines
|
from parso.utils import split_lines
|
||||||
|
|
||||||
|
|
||||||
@@ -334,8 +333,6 @@ class BaseNode(NodeOrLeaf):
|
|||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
code = self.get_code().replace('\n', ' ').replace('\r', ' ').strip()
|
code = self.get_code().replace('\n', ' ').replace('\r', ' ').strip()
|
||||||
if not sys.version_info.major >= 3:
|
|
||||||
code = code.encode(encoding, 'replace')
|
|
||||||
return "<%s: %s@%s,%s>" % \
|
return "<%s: %s@%s,%s>" % \
|
||||||
(type(self).__name__, code, self.start_pos[0], self.start_pos[1])
|
(type(self).__name__, code, self.start_pos[0], self.start_pos[1])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user