Skip to content

Commit

Permalink
Testing: Remove utf-8 declaration from add_header script; #6538
Browse files Browse the repository at this point in the history
UTF-8 is the default source encoding in Python 3.
Declaring it is unncessary, unless Python 2 is also supported.
See also:
- https://peps.python.org/pep-3120/
- https://docs.python.org/3/howto/unicode.html#python-s-unicode-support
- https://stackoverflow.com/questions/14083111/should-i-use-encoding-declaration-in-python-3
  • Loading branch information
rdimaio authored and bari12 committed Apr 2, 2024
1 parent 3724039 commit 093a9be
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/add_header
Expand Up @@ -306,8 +306,7 @@ class PythonHeaderTemplate(HeaderTemplate):
shebag_string = PythonHeaderTemplate._get_file_shebag(self.file_path) or ""

return shebag_string \
+ """# -*- coding: utf-8 -*-
# Copyright European Organization for Nuclear Research (CERN) since 2012
+ """# Copyright European Organization for Nuclear Research (CERN) since 2012
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 093a9be

Please sign in to comment.