From 39cd4a436b4d141b6593bb048934ff87c55c1f19 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 15 Jul 2014 12:50:58 +0200 Subject: [PATCH] Allow empty license headers being applied to files refs #6309 --- bin/license_writer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/license_writer.py b/bin/license_writer.py index 5357961bb..c0b68701e 100755 --- a/bin/license_writer.py +++ b/bin/license_writer.py @@ -191,6 +191,9 @@ def get_license(type): try: return __LICENSE_STORE[type] except(KeyError): + if not LICENSE_DATA: + __LICENSE_STORE[type] = '' + return '' config = FILE_TYPE_CONFIG[type] license_data = [] license_data.extend([''] * config['linesBefore']) @@ -239,8 +242,9 @@ def replace_text(org_data, license_data): test = True elif SECTION_MARKER.search(line) and test == True: test = False - out += license_data - out += '\n' + if license_data: + out += license_data + out += '\n' elif test == True: continue