diff --git a/src/rosdep2/sources_list.py b/src/rosdep2/sources_list.py index b0de6d8b10..2542875c91 100644 --- a/src/rosdep2/sources_list.py +++ b/src/rosdep2/sources_list.py @@ -545,11 +545,11 @@ def get_source(source): This closure uses variables from parent scope """ def get_additional_sources(dist_name): + distribution = get_index().distributions[dist_name] if dist_name != ros_distro: if ros_distro is not None: print('Skip distro "%s" different from requested "%s"' % (dist_name, ros_distro)) return - distribution = get_index().distributions[dist_name] if skip_eol_distros: if distribution.get('distribution_status') == 'end-of-life': print('Skip end-of-life distro "%s"' % dist_name)