[elbe-devel] [PATCH 09/25] [V2] py3: remove usage of long variables

Torben Hohn torben.hohn at linutronix.de
Fri Dec 15 16:54:45 CET 2017


On Fri, Dec 08, 2017 at 07:08:40PM +0100, Manuel Traut wrote:
> long is no longer available in py3, replace it by integer
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>
> ---
>  elbepack/aptprogress.py | 4 ++--
>  elbepack/ziparchives.py | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/elbepack/aptprogress.py b/elbepack/aptprogress.py
> index 009a11bc..7bca047a 100644
> --- a/elbepack/aptprogress.py
> +++ b/elbepack/aptprogress.py
> @@ -68,7 +68,7 @@ class ElbeAcquireProgress (AcquireProgress):
>  
>      def __init__ (self, cb=None):
>          AcquireProgress.__init__ (self)
> -        self._id = long(1)
> +        self._id = 1
>          self.cb = cb
>  
>      def write (self, line):
> @@ -106,7 +106,7 @@ class ElbeOpProgress (OpProgress):
>  
>      def __init__ (self, cb=None):
>          OpProgress.__init__ (self)
> -        self._id = long(1)
> +        self._id = int(1)

You fixed my comment above...
but at this place not...

from old review.,..

------------------------------------------------------------------------------------
> diff --git a/elbepack/aptprogress.py b/elbepack/aptprogress.py                                                                                       
> index 009a11bc..d3b09436 100644                                                                                                                      
> --- a/elbepack/aptprogress.py                                                                                                                        
> +++ b/elbepack/aptprogress.py                                                                                                                        
> @@ -68,7 +68,7 @@ class ElbeAcquireProgress (AcquireProgress):                                                                                       
>                                                                                                                                                      
>      def __init__ (self, cb=None):                                                                                                                   
>          AcquireProgress.__init__ (self)                                                                                                             
> -        self._id = long(1)                                                                                                                          
> +        self._id = int(1)                                                                                                                           
                                                                                                                                                       
you dont have to convert 1 to an integer.                                                                                                              
this was due to no implicit conversion at that point, iirc.                                                                                            
no cookie.

                                                                                                                                                       
>          self.cb = cb
>  
>      def write (self, line):
> diff --git a/elbepack/ziparchives.py b/elbepack/ziparchives.py
> index af5ee931..4c245ff5 100644
> --- a/elbepack/ziparchives.py
> +++ b/elbepack/ziparchives.py
> @@ -35,7 +35,7 @@ def create_zip_archive( zipfilename, path, inarchpath ):
>                      archname = archname[2:]
>                  zi = ZipInfo( archname)
>                  stat = os.stat( path + '/' + archname )
> -                zi.external_attr = stat.st_mode << 16L
> +                zi.external_attr = stat.st_mode << 16
>                  # this hack is needed to use the external attributes
>                  # there is no way to set a zipinfo object directly to an archive
>                  with open (filename, 'rb') as f:
> -- 
> 2.15.1
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Mit freundlichen Grüßen
Torben Hohn

Linutronix GmbH

Standort: Bremen

Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Firmensitz / Registered Office: D-88690 Uhldingen, Bahnhofstr. 3
Registergericht / Local District Court: Amtsgericht Freiburg i. Br.; HRB
Nr. / Trade register no.: 700 806

Geschäftsführer / Managing Directors: Heinz Egger, Thomas Gleixner

Eine Bitte von uns: Sollten Sie diese E-Mail irrtümlich erhalten haben,
benachrichtigen Sie uns in diesem Falle bitte sobald wie es Ihnen
möglich ist, durch Antwort-Mail. Vielen Dank!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20171215/b19533e4/attachment.sig>


More information about the elbe-devel mailing list