mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The `__future__` we relied on is now, where the 3 specific things are all included [since Python 3.0](https://docs.python.org/3/library/__future__.html): * absolute_import * print_function * unicode_literals * division These import statements are no-ops and are no longer necessary.
28 lines
788 B
Python
28 lines
788 B
Python
#! /usr/bin/env python3
|
|
# -*- python -*-
|
|
# RUN: %{python} %s '%swift_src_root'
|
|
|
|
import os.path
|
|
import subprocess
|
|
import sys
|
|
|
|
if len(sys.argv) < 2:
|
|
print('Invalid number of arguments.')
|
|
sys.exit(1)
|
|
|
|
swift_src_root = sys.argv[1]
|
|
if not os.path.exists(os.path.join(swift_src_root, '.git')):
|
|
# It is fine if the folder doesn't exist
|
|
sys.exit(0)
|
|
|
|
returncode = subprocess.call(
|
|
['git', '-C', swift_src_root, 'grep', r'\bDEBUG[(]'])
|
|
if returncode == 0: # We found some DEBUG in there.
|
|
print("""
|
|
*** The {DEBUG}(...) macro is being renamed to LLVM_DEBUG(...);
|
|
*** please use that instead.""".format(DEBUG='DEBUG'))
|
|
sys.exit(1)
|
|
|
|
# If you see a failure in this test, that means you introduced a use of the
|
|
# DEBUG macro from LLVM, which is being renamed to LLVM_DEBUG.
|