This is an archive of the discontinued Mercurial Phabricator instance.

hgdemandimport: don't use str.isidentifier()
AbandonedPublic

Authored by indygreg on Oct 13 2018, 3:28 AM.

Details

Reviewers
baymax
Group Reviewers
hg-reviewers
Summary

This method doesn't exist in Python 2.7.

The new code is equivalent to what Python was doing up until
isidentifier() was introduced to Lib/tokenize.py in
33856de84d1115a18b699e0ca93c3b921bc6a1af.

Strictly speaking, a simple ascii check is not sufficient, as a proper
identifier is defined by PEP 3131 and allows non-ascii characters. But
we don't plan to use this tokenizer on arbitrary source code, so I think
we can get away with not conforming to PEP 3131.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

indygreg created this revision.Oct 13 2018, 3:28 AM
baymax requested changes to this revision.Jan 24 2020, 12:32 PM

There seems to have been no activities on this Diff for the past 3 Months.

By policy, we are automatically moving it out of the need-review state.

Please, move it back to need-review without hesitation if this diff should still be discussed.

:baymax:need-review-idle:

This revision now requires changes to proceed.Jan 24 2020, 12:32 PM
indygreg abandoned this revision.Jan 24 2020, 11:51 PM