Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup dead code and fix some imports. #283

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

sodul
Copy link
Collaborator

@sodul sodul commented Jan 25, 2024

This removes code that was here for older versions of python that we no longer support. Unused imports have been removed while missing ones have been added.

This removes code that was here for older versions of python that we no longer support.
Unused imports have been removed while missing ones have been added.
@sodul sodul added this to the 4.0.1 milestone Jan 25, 2024
@sodul sodul self-assigned this Jan 25, 2024
@@ -441,7 +441,7 @@ def parseArguments(argv=None): # pragma: no cover
),
default=argparse.SUPPRESS,
)
),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This made a tuple declaration serving no purpose.

import sys
import unittest
from configparser import ConfigParser
from unittest.mock import patch, MagicMock, call
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new imports are actually used which makes me feel that this part of the test code is not actually being run.

"""
try:
import coverage
except ImportError:
self.skipTest("Coverage needs to be installed for this test")
self.assertTrue(coverage.version_info)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This double up as a way to 'use' coverage so linters do not complained about unused imports.

Copy link
Collaborator

@IanFoertsch-clumio IanFoertsch-clumio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I've manually validated all the import-related changes here, and removing the old python 2 related code makes sense as 3.8 is now the minimum version.

@@ -737,14 +735,6 @@ def printErrors(self):
if not self.args.no_tracebacks:
relevant_frames = []
for i, frame in enumerate(err.traceback_lines):
# Python2 tracebacks containing unicode need some special handling
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the minimum python version is now 3.8, so this make sense 👍

@sodul sodul merged commit d1e1bf5 into CleanCut:main Jan 25, 2024
24 checks passed
@sodul sodul deleted the dead-code branch January 25, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants