mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
BaseTest: Reorganize imports and make shlex global
This commit is contained in:
parent
331609eb6e
commit
6100933a28
1 changed files with 6 additions and 8 deletions
|
@ -1,15 +1,15 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
|
||||||
import tempfile
|
|
||||||
import shutil
|
|
||||||
import atexit
|
import atexit
|
||||||
import unittest
|
|
||||||
import json
|
import json
|
||||||
from .utils import (run_cmd_wait, run_cmd_wait_nofail, which,
|
import os
|
||||||
task_binary_location)
|
import shlex
|
||||||
|
import shutil
|
||||||
|
import tempfile
|
||||||
|
import unittest
|
||||||
from .exceptions import CommandError
|
from .exceptions import CommandError
|
||||||
from .hooks import Hooks
|
from .hooks import Hooks
|
||||||
|
from .utils import run_cmd_wait, run_cmd_wait_nofail, which, task_binary_location
|
||||||
|
|
||||||
|
|
||||||
class Task(object):
|
class Task(object):
|
||||||
|
@ -166,12 +166,10 @@ class Task(object):
|
||||||
try:
|
try:
|
||||||
# Python 2.x
|
# Python 2.x
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, basestring):
|
||||||
import shlex
|
|
||||||
args = shlex.split(args)
|
args = shlex.split(args)
|
||||||
except NameError:
|
except NameError:
|
||||||
# Python 3.x
|
# Python 3.x
|
||||||
if isinstance(args, str):
|
if isinstance(args, str):
|
||||||
import shlex
|
|
||||||
args = shlex.split(args)
|
args = shlex.split(args)
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue