mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Issue #20363. Fixed BytesWarning triggerred by test suite.
Patch by Berker Peksag.
This commit is contained in:
parent
5e028ae09e
commit
bc27a050a7
3 changed files with 4 additions and 4 deletions
|
@ -286,7 +286,7 @@ class ParsingError(Error):
|
||||||
raise ValueError("Required argument `source' not given.")
|
raise ValueError("Required argument `source' not given.")
|
||||||
elif filename:
|
elif filename:
|
||||||
source = filename
|
source = filename
|
||||||
Error.__init__(self, 'Source contains parsing errors: %s' % source)
|
Error.__init__(self, 'Source contains parsing errors: %r' % source)
|
||||||
self.source = source
|
self.source = source
|
||||||
self.errors = []
|
self.errors = []
|
||||||
self.args = (source, )
|
self.args = (source, )
|
||||||
|
@ -322,7 +322,7 @@ class MissingSectionHeaderError(ParsingError):
|
||||||
def __init__(self, filename, lineno, line):
|
def __init__(self, filename, lineno, line):
|
||||||
Error.__init__(
|
Error.__init__(
|
||||||
self,
|
self,
|
||||||
'File contains no section headers.\nfile: %s, line: %d\n%r' %
|
'File contains no section headers.\nfile: %r, line: %d\n%r' %
|
||||||
(filename, lineno, line))
|
(filename, lineno, line))
|
||||||
self.source = filename
|
self.source = filename
|
||||||
self.lineno = lineno
|
self.lineno = lineno
|
||||||
|
|
|
@ -300,5 +300,5 @@ Your selection [default 1]: ''', log.INFO)
|
||||||
result = 200, 'OK'
|
result = 200, 'OK'
|
||||||
if self.show_response:
|
if self.show_response:
|
||||||
dashes = '-' * 75
|
dashes = '-' * 75
|
||||||
self.announce('%s%s%s' % (dashes, data, dashes))
|
self.announce('%s%r%s' % (dashes, data, dashes))
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -138,7 +138,7 @@ class HashRandomizationTests:
|
||||||
# an object to be tested
|
# an object to be tested
|
||||||
|
|
||||||
def get_hash_command(self, repr_):
|
def get_hash_command(self, repr_):
|
||||||
return 'print(hash(%s))' % repr_
|
return 'print(hash(eval(%a)))' % repr_
|
||||||
|
|
||||||
def get_hash(self, repr_, seed=None):
|
def get_hash(self, repr_, seed=None):
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue