Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f2e6f1

Browse files
Revert unneccessary changes made in bpo-30296 and apply other improvements. (GH-2624)
1 parent 6f600ff commit 3f2e6f1

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

Lib/logging/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def configure_custom(self, config):
460460
c = self.resolve(c)
461461
props = config.pop('.', None)
462462
# Check for valid identifiers
463-
kwargs = dict((k, config[k]) for k in config if valid_ident(k))
463+
kwargs = {k: config[k] for k in config if valid_ident(k)}
464464
result = c(**kwargs)
465465
if props:
466466
for name, value in props.items():
@@ -723,7 +723,7 @@ def configure_handler(self, config):
723723
config['address'] = self.as_tuple(config['address'])
724724
factory = klass
725725
props = config.pop('.', None)
726-
kwargs = dict((k, config[k]) for k in config if valid_ident(k))
726+
kwargs = {k: config[k] for k in config if valid_ident(k)}
727727
try:
728728
result = factory(**kwargs)
729729
except TypeError as te:

Lib/pstats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def add_callers(target, source):
530530
if func in new_callers:
531531
if isinstance(caller, tuple):
532532
# format used by cProfile
533-
new_callers[func] = tuple(i[0] + i[1] for i in zip(caller, new_callers[func]))
533+
new_callers[func] = tuple(i + j for i, j in zip(caller, new_callers[func]))
534534
else:
535535
# format used by profile
536536
new_callers[func] += caller

Lib/turtle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3839,7 +3839,7 @@ def write_docstringdict(filename="turtle_docstringdict"):
38393839
docsdict[key] = eval(key).__doc__
38403840

38413841
with open("%s.py" % filename,"w") as f:
3842-
keys = sorted(x for x in docsdict.keys()
3842+
keys = sorted(x for x in docsdict
38433843
if x.split('.')[1] not in _alias_list)
38443844
f.write('docsdict = {\n\n')
38453845
for key in keys[:-1]:

Lib/urllib/request.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,8 @@ def do_open(self, http_class, req, **http_conn_args):
12861286
h.set_debuglevel(self._debuglevel)
12871287

12881288
headers = dict(req.unredirected_hdrs)
1289-
headers.update((k, v) for k, v in req.headers.items() if k not in headers)
1289+
headers.update({k: v for k, v in req.headers.items()
1290+
if k not in headers})
12901291

12911292
# TODO(jhylton): Should this be redesigned to handle
12921293
# persistent connections?

0 commit comments

Comments
 (0)