Skip to content

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Aug 12, 2020

self.assertIn(b'usage', lines[0])
# The first line contains the program name,
# but the rest should be ASCII-only
b''.join(lines[1:]).decode('ascii')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would decoding each line separately be faster?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, decoding one large string at once is faster.

@@ -83,7 +83,7 @@ static const char usage_3[] = "\
cumulative time (including nested imports) and self time (excluding\n\
nested imports). Note that its output may be broken in multi-threaded\n\
application. Typical usage is python3 -X importtime -c 'import asyncio'\n\
-X dev: enable CPython’s “development mode, introducing additional runtime\n\
-X dev: enable CPython's \"development mode\", introducing additional runtime\n\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though conversion would be a different issue, I am curious whether there is any good reason to not use """ quotes for the string instead of "s and '\n\' and '"'.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is C.

@pablogsal
Copy link
Member

@serhiy-storchaka There is some problem with the CI and the last commit. I am going to push an amended commit (git commit --amend --noedit) to unblock the CI

@pablogsal pablogsal merged commit 58de1dd into python:master Sep 9, 2020
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2020
(cherry picked from commit 58de1dd)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Sep 9, 2020
@bedevere-bot
Copy link

GH-22162 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2020
(cherry picked from commit 58de1dd)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot
Copy link

GH-22163 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Sep 9, 2020
(cherry picked from commit 58de1dd)

Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington added a commit that referenced this pull request Sep 9, 2020
(cherry picked from commit 58de1dd)

Co-authored-by: Serhiy Storchaka <[email protected]>
@serhiy-storchaka
Copy link
Member Author

Thank you Pablo!

xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants