drop asyncore; pyftpdlib has vendored it

This commit is contained in:
ed 2023-11-11 17:20:00 +00:00
parent bac733113c
commit 7c0c6b94a3
4 changed files with 15 additions and 33 deletions

View file

@ -16,16 +16,11 @@ def uncomment(fpath):
orig = f.read().decode("utf-8")
out = ""
for ln in orig.split("\n"):
if not ln.startswith("#"):
break
out += ln + "\n"
io_obj = io.StringIO(orig)
prev_toktype = tokenize.INDENT
last_lineno = -1
last_col = 0
code = False
for tok in tokenize.generate_tokens(io_obj.readline):
# print(repr(tok))
token_type = tok[0]
@ -53,7 +48,11 @@ def uncomment(fpath):
out += token_string
else:
out += '"a"'
elif token_type != tokenize.COMMENT or is_legalese:
elif token_type != tokenize.COMMENT:
out += token_string
if not code and token_string.strip():
code = True
elif is_legalese or (not start_col and not code):
out += token_string
else:
if out.rstrip(" ").endswith("\n"):