diff mbox

[2/3] docker.py: Python 2.6 argparse compatibility

Message ID 20170825155732.15665-3-stefanha@redhat.com
State New
Headers show

Commit Message

Stefan Hajnoczi Aug. 25, 2017, 3:57 p.m. UTC
Add the scripts/ directory to sys.path so Python 2.6 will be able to
import argparse.

Cc: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/docker/docker.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Fam Zheng Aug. 26, 2017, 12:29 a.m. UTC | #1
On Fri, 08/25 16:57, Stefan Hajnoczi wrote:
> Add the scripts/ directory to sys.path so Python 2.6 will be able to
> import argparse.
> 
> Cc: Fam Zheng <famz@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  tests/docker/docker.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/docker/docker.py b/tests/docker/docker.py
> index ee40ca04d9..81c87ee329 100755
> --- a/tests/docker/docker.py
> +++ b/tests/docker/docker.py
> @@ -13,12 +13,14 @@
>  
>  import os
>  import sys
> +sys.path.append(os.path.join(os.path.dirname(__file__),
> +                             '..', '..', 'scripts'))
> +import argparse
>  import subprocess
>  import json
>  import hashlib
>  import atexit
>  import uuid
> -import argparse
>  import tempfile
>  import re
>  import signal
> -- 
> 2.13.5
> 

Acked-by: Fam Zheng <famz@redhat.com>
diff mbox

Patch

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index ee40ca04d9..81c87ee329 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -13,12 +13,14 @@ 
 
 import os
 import sys
+sys.path.append(os.path.join(os.path.dirname(__file__),
+                             '..', '..', 'scripts'))
+import argparse
 import subprocess
 import json
 import hashlib
 import atexit
 import uuid
-import argparse
 import tempfile
 import re
 import signal