# Path: catkin_tools/commands/catkin.py
# def main(sysargs=None):
#     try:
#         catkin_main(sysargs)
#     except KeyboardInterrupt:
#         print('Interrupted by user!')


import functools
import os
import re
import shutil
import subprocess
import sys
import tempfile
            import traceback
from io import StringIO
from subprocess import TimeoutExpired
from catkin_tools.commands.catkin import main as catkin_main
            from inspect import getargspec



TESTS_DIR = os.path.dirname(__file__)
MOCK_DIR = os.path.join(TESTS_DIR, 'mock_resources')


def catkin_success(args, env={}):
    orig_environ = dict(os.environ)
    try:
        os.environ.update(env)
        catkin_main(args)
    except SystemExit as exc:
        ret = exc.code
        if ret != 0:
            traceback.print_exc()
    finally:
        os.environ = orig_environ
    return ret == 0


def catkin_failure(args, env={}):
    orig_environ = dict(os.environ)
    try:
        os.environ.update(env)

# Path: catkin_tools/commands/catkin.py
# def main(sysargs=None):
#     try:
#         catkin_main(sysargs)
#     except KeyboardInterrupt:
#         print('Interrupted by user!')


# Path: tests/utils.py
import functools
import os
import re
import shutil
import subprocess
import sys
import tempfile
            import traceback
from io import StringIO
from subprocess import TimeoutExpired
from catkin_tools.commands.catkin import main as catkin_main
            from inspect import getargspec




TESTS_DIR = os.path.dirname(__file__)
MOCK_DIR = os.path.join(TESTS_DIR, 'mock_resources')


def catkin_success(args, env={}):
    orig_environ = dict(os.environ)
    try:
        os.environ.update(env)
        catkin_main(args)
    except SystemExit as exc:
        ret = exc.code
        if ret != 0:
            traceback.print_exc()
    finally:
        os.environ = orig_environ
    return ret == 0


def catkin_failure(args, env={}):
    orig_environ = dict(os.environ)
    try:
        os.environ.update(env)

        catkin_main(args)