Skip to content

[Python] Use explicit imports (again) - split up to avoid pygments issue in #757 #758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion tools/SourceKit/bindings/python/sourcekitd/capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@
#
#===------------------------------------------------------------------------===#

from ctypes import *
from ctypes import (
CFUNCTYPE,
POINTER,
Structure,
addressof,
c_bool,
c_char_p,
c_int,
c_int64,
c_size_t,
c_uint64,
c_void_p,
cdll,
py_object,
string_at,
)

# ctypes doesn't implicitly convert c_void_p to the appropriate wrapper
# object. This is a problem, because it means that from_parameter will see an
Expand Down
12 changes: 10 additions & 2 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ import textwrap

sys.path.append(os.path.dirname(__file__))

from SwiftBuildSupport import *

from SwiftBuildSupport import (
HOME,
SWIFT_BUILD_ROOT,
SWIFT_SOURCE_ROOT,
check_call,
get_all_preset_names,
get_preset_options,
print_with_argv0,
quote_shell_command,
)

# Main entry point for the preset mode.
def main_preset():
Expand Down
4 changes: 2 additions & 2 deletions utils/cmpcodesize/cmpcodesize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

import cmpcodesize
from cmpcodesize.main import main

if __name__ == '__main__':
cmpcodesize.main()
main()
3 changes: 0 additions & 3 deletions utils/cmpcodesize/cmpcodesize/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from .main import main

__author__ = 'Brian Gesiak'
__email__ = '[email protected]'
__versioninfo__ = (0, 1, 0)
Expand Down
2 changes: 1 addition & 1 deletion utils/recursive-lipo
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import filecmp
import os
import shutil

from SwiftBuildSupport import *
from SwiftBuildSupport import check_call

def merge_file_lists(src_root_dirs, skip_files, skip_subpaths):
"""Merges the file lists recursively from all src_root_dirs supplied,
Expand Down
8 changes: 6 additions & 2 deletions utils/update-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ import sys

sys.path.append(os.path.dirname(__file__))

from SwiftBuildSupport import *

from SwiftBuildSupport import (
SWIFT_SOURCE_ROOT,
WorkingDirectory,
check_call,
check_output,
)

def update_git_svn(repo_path):
with WorkingDirectory(repo_path):
Expand Down