[PATCH] py3: remove use of *L syntax

Pulkit Goyal 7895pulkit at gmail.com
Wed Aug 31 23:14:57 UTC 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1472677186 -19800
#      Thu Sep 01 02:29:46 2016 +0530
# Node ID 5ffa4cfc09d7c563b09bc3d4fbd50bccff16aa6a
# Parent  8a84347b9907ada91f9f3a21aca1fb62cac0fed5
py3: remove use of *L syntax

The int in Python 3 behaves as long so no need of L's in py3.
Moreover we dont need long here.

diff -r 8a84347b9907 -r 5ffa4cfc09d7 hgext/color.py
--- a/hgext/color.py	Mon Aug 29 17:48:14 2016 -0700
+++ b/hgext/color.py	Thu Sep 01 02:29:46 2016 +0530
@@ -558,8 +558,8 @@
                     ('srWindow', _SMALL_RECT),
                     ('dwMaximumWindowSize', _COORD)]
 
-    _STD_OUTPUT_HANDLE = 0xfffffff5L # (DWORD)-11
-    _STD_ERROR_HANDLE = 0xfffffff4L  # (DWORD)-12
+    _STD_OUTPUT_HANDLE = 0xfffffff5 # (DWORD)-11
+    _STD_ERROR_HANDLE = 0xfffffff4  # (DWORD)-12
 
     _FOREGROUND_BLUE = 0x0001
     _FOREGROUND_GREEN = 0x0002
diff -r 8a84347b9907 -r 5ffa4cfc09d7 mercurial/archival.py
--- a/mercurial/archival.py	Mon Aug 29 17:48:14 2016 -0700
+++ b/mercurial/archival.py	Thu Sep 01 02:29:46 2016 +0530
@@ -231,7 +231,7 @@
         if islink:
             mode = 0o777
             ftype = _UNX_IFLNK
-        i.external_attr = (mode | ftype) << 16L
+        i.external_attr = (mode | ftype) << 16
         # add "extended-timestamp" extra block, because zip archives
         # without this will be extracted with unexpected timestamp,
         # if TZ is not configured as GMT
diff -r 8a84347b9907 -r 5ffa4cfc09d7 mercurial/commands.py
--- a/mercurial/commands.py	Mon Aug 29 17:48:14 2016 -0700
+++ b/mercurial/commands.py	Thu Sep 01 02:29:46 2016 +0530
@@ -3381,9 +3381,9 @@
     nump2prev = 0
     chainlengths = []
 
-    datasize = [None, 0, 0L]
-    fullsize = [None, 0, 0L]
-    deltasize = [None, 0, 0L]
+    datasize = [None, 0, 0]
+    fullsize = [None, 0, 0]
+    deltasize = [None, 0, 0]
 
     def addsize(size, l):
         if l[0] is None or size < l[0]:
diff -r 8a84347b9907 -r 5ffa4cfc09d7 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Mon Aug 29 17:48:14 2016 -0700
+++ b/tests/test-check-py3-compat.t	Thu Sep 01 02:29:46 2016 +0530
@@ -26,7 +26,7 @@
   hgext/children.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   hgext/churn.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   hgext/clonebundles.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
-  hgext/color.py: invalid syntax: invalid syntax (<unknown>, line *)
+  hgext/color.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   hgext/convert/bzr.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   hgext/convert/common.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   hgext/convert/convcmd.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
@@ -79,7 +79,7 @@
   hgext/transplant.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   hgext/win32mbcs.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   hgext/win32text.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
-  mercurial/archival.py: invalid syntax: invalid syntax (<unknown>, line *)
+  mercurial/archival.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   mercurial/bookmarks.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   mercurial/branchmap.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   mercurial/bundle2.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
@@ -88,7 +88,7 @@
   mercurial/changegroup.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   mercurial/changelog.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   mercurial/cmdutil.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
-  mercurial/commands.py: invalid syntax: invalid syntax (<unknown>, line *)
+  mercurial/commands.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   mercurial/commandserver.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   mercurial/config.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)
   mercurial/context.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*)


More information about the Mercurial-devel mailing list