Skip to content

Commit 4fc8c56

Browse files
committed
Replace pass with rais NotImplemented in each abstact method
The methods themselfes do nothing within the abstract base class mbedToolchain. This change enforces that toolchains do not call these methods that contain no implementation.
1 parent 69eb3ca commit 4fc8c56

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tools/toolchains/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ def parse_dependencies(self, dep_path):
792792
"""Take in a dependency file generated by the compiler and build a list of
793793
all files that the dep_path depends on.
794794
"""
795-
pass
795+
raise NotImplemented
796796

797797
def is_not_supported_error(self, output):
798798
return "#error directive: [NOT_SUPPORTED]" in output
@@ -801,7 +801,7 @@ def is_not_supported_error(self, output):
801801
def parse_output(self, output):
802802
"""Take in compiler output and extract sinlge line warnings and errors from it
803803
"""
804-
pass
804+
raise NotImplemented
805805

806806
def compile_output(self, output=[]):
807807
_rc = output[0]
@@ -979,7 +979,7 @@ def get_config_option(self, config_header):
979979
"""Generate the compiler option that forces the inclusion of the configuration
980980
header file.
981981
"""
982-
pass
982+
raise NotImplemented
983983

984984
@abstractmethod
985985
def assemble(self, source, object, includes):
@@ -988,7 +988,7 @@ def assemble(self, source, object, includes):
988988
- Puts the results into the file named *object*.
989989
- Has an include search path that includes everything in *includes*
990990
"""
991-
pass
991+
raise NotImplemented
992992

993993
@abstractmethod
994994
def compile_c(self, source, object, includes):
@@ -997,7 +997,7 @@ def compile_c(self, source, object, includes):
997997
- Puts the results into the file named *object*.
998998
- Has an include search path that includes everything in *includes*
999999
"""
1000-
pass
1000+
raise NotImplemented
10011001

10021002
@abstractmethod
10031003
def compile_cpp(self, source, object, includes):
@@ -1006,7 +1006,7 @@ def compile_cpp(self, source, object, includes):
10061006
- Puts the results into the file named *object*.
10071007
- Has an include search path that includes everything in *includes*
10081008
"""
1009-
pass
1009+
raise NotImplemented
10101010

10111011
@abstractmethod
10121012
def link(self, output, objects, libraries, lib_dirs, mem_map):
@@ -1016,20 +1016,20 @@ def link(self, output, objects, libraries, lib_dirs, mem_map):
10161016
- Searches for libraries in *lib_dirs*
10171017
- Generates a memory map file in the file *mem_map*
10181018
"""
1019-
pass
1019+
raise NotImplemented
10201020

10211021
@abstractmethod
10221022
def archive(self, objects, lib_path):
10231023
"""Run the command line that creates an archive containing *objects*, and named *lib_path*
10241024
"""
1025-
pass
1025+
raise NotImplemented
10261026

10271027
@abstractmethod
10281028
def binary(self, resources, elf, bin):
10291029
"""Run the command line that will Extract a binary named *bin* from an
10301030
elf file named *elf*.
10311031
"""
1032-
pass
1032+
raise NotImplemented
10331033

10341034
# Return the list of macros geenrated by the build system
10351035
def get_config_macros(self):

0 commit comments

Comments
 (0)