Mercurial > hg
comparison mercurial/utils/procutil.py @ 43655:ef43765c921d
py3: use native string as fallback value for __file__ for consistency
This is not a bugfix (pycommpat.fsencode(b'') is a no-op on py3), but
the b'' value was inconsistent and confusing.
Differential Revision: https://phab.mercurial-scm.org/D7412
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 14 Nov 2019 14:03:02 -0800 |
parents | 9f70512ae2cf |
children | 47d983f0af65 |
comparison
equal
deleted
inserted
replaced
43654:c5548b0b6847 | 43655:ef43765c921d |
---|---|
287 else: | 287 else: |
288 _sethgexecutable(pycompat.sysexecutable) | 288 _sethgexecutable(pycompat.sysexecutable) |
289 elif ( | 289 elif ( |
290 not pycompat.iswindows | 290 not pycompat.iswindows |
291 and os.path.basename( | 291 and os.path.basename( |
292 pycompat.fsencode(getattr(mainmod, '__file__', b'')) | 292 pycompat.fsencode(getattr(mainmod, '__file__', '')) |
293 ) | 293 ) |
294 == b'hg' | 294 == b'hg' |
295 ): | 295 ): |
296 _sethgexecutable(pycompat.fsencode(mainmod.__file__)) | 296 _sethgexecutable(pycompat.fsencode(mainmod.__file__)) |
297 else: | 297 else: |