Patchwork setup: write version constant as bytes literal

login
register
mail settings
Submitter Yuya Nishihara
Date June 1, 2018, 3:04 p.m.
Message ID <3cc63fbb28e2139cf9a0.1527865474@mimosa>
Download mbox | patch
Permalink /patch/31931/
State Accepted
Headers show

Comments

Yuya Nishihara - June 1, 2018, 3:04 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1527861756 -32400
#      Fri Jun 01 23:02:36 2018 +0900
# Node ID 3cc63fbb28e2139cf9a0f7b153bd3f98125f4df9
# Parent  273ce823ba5c657623441bcde526e54811c90fb1
setup: write version constant as bytes literal

Spotted while bulk-rewriting string literals to b''s.
Augie Fackler - June 1, 2018, 6:11 p.m.
> On Jun 1, 2018, at 11:04, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1527861756 -32400
> #      Fri Jun 01 23:02:36 2018 +0900
> # Node ID 3cc63fbb28e2139cf9a0f7b153bd3f98125f4df9
> # Parent  273ce823ba5c657623441bcde526e54811c90fb1
> setup: write version constant as bytes literal

Queued, thanks

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -360,7 +360,7 @@  if version:
 
     write_if_changed('mercurial/__version__.py', b''.join([
         b'# this file is autogenerated by setup.py\n'
-        b'version = "%s"\n' % versionb,
+        b'version = b"%s"\n' % versionb,
     ]))
 
 try: