Patchwork [6,of,7] py3: use absolute_import in svn-safe-append.py

login
register
mail settings
Submitter roby roby
Date April 16, 2016, 3:11 a.m.
Message ID <9201693167c4c7955209.1460776302@roby>
Download mbox | patch
Permalink /patch/14672/
State Changes Requested
Delegated to: Yuya Nishihara
Headers show

Comments

roby roby - April 16, 2016, 3:11 a.m.
# HG changeset patch
# User Robert Stanca <robert.stanca7@gmail.com>
# Date 1460774185 -10800
#      Sat Apr 16 05:36:25 2016 +0300
# Node ID 9201693167c4c79552093689cfa985b04456a5d8
# Parent  329b0dca309f81b78222d22ff2361bde29e1e71c
py3: use absolute_import in svn-safe-append.py
Yuya Nishihara - April 16, 2016, 1:45 p.m.
On Sat, 16 Apr 2016 06:11:42 +0300, Robert Stanca wrote:
> # HG changeset patch
> # User Robert Stanca <robert.stanca7@gmail.com>
> # Date 1460774185 -10800
> #      Sat Apr 16 05:36:25 2016 +0300
> # Node ID 9201693167c4c79552093689cfa985b04456a5d8
> # Parent  329b0dca309f81b78222d22ff2361bde29e1e71c
> py3: use absolute_import in svn-safe-append.py

Dropped this, and queued the other patches, thanks.

> diff -r 329b0dca309f -r 9201693167c4 tests/svn-safe-append.py
> --- a/tests/svn-safe-append.py	Sat Apr 16 05:34:21 2016 +0300
> +++ b/tests/svn-safe-append.py	Sat Apr 16 05:36:25 2016 +0300
> @@ -3,7 +3,9 @@
>  __doc__ = """Same as `echo a >> b`, but ensures a changed mtime of b.
>  Without this svn will not detect workspace changes."""
>  
> -import sys, os
> +from __future__ import absolute_import

  File "tests/svn-safe-append.py", line 6
    from __future__ import absolute_import
  SyntaxError: from __future__ imports must occur at the beginning of the file

You'll need to remove the unneeded "__doc__ = " statement. The first string
literal can be a module __doc__ automatically.

Patch

diff -r 329b0dca309f -r 9201693167c4 tests/svn-safe-append.py
--- a/tests/svn-safe-append.py	Sat Apr 16 05:34:21 2016 +0300
+++ b/tests/svn-safe-append.py	Sat Apr 16 05:36:25 2016 +0300
@@ -3,7 +3,9 @@ 
 __doc__ = """Same as `echo a >> b`, but ensures a changed mtime of b.
 Without this svn will not detect workspace changes."""
 
-import sys, os
+from __future__ import absolute_import
+import os
+import sys
 
 text = sys.argv[1]
 fname = sys.argv[2]
diff -r 329b0dca309f -r 9201693167c4 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Sat Apr 16 05:34:21 2016 +0300
+++ b/tests/test-check-py3-compat.t	Sat Apr 16 05:36:25 2016 +0300
@@ -45,7 +45,6 @@ 
   tests/readlink.py not using absolute_import
   tests/readlink.py requires print_function
   tests/run-tests.py not using absolute_import
-  tests/svn-safe-append.py not using absolute_import
   tests/svnxml.py not using absolute_import
   tests/test-atomictempfile.py not using absolute_import
   tests/test-demandimport.py not using absolute_import