Skip to content

Commit

Permalink
Removed special handling of Python 2 in cli.py and utils.py; added py…
Browse files Browse the repository at this point in the history
…project.toml to distribution
  • Loading branch information
heuer committed Oct 25, 2023
1 parent b105c1b commit bdb6c42
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include LICENSE *.txt *.rst segno/*.pyi segno/py.typed
include LICENSE *.txt *.rst segno/*.pyi segno/py.typed pyproject.toml
exclude requirements*
6 changes: 2 additions & 4 deletions segno/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@


def _get_args(func):
# Python 2 vs Python 3
func_code = getattr(func, 'func_code', None) or func.__code__
defaults = getattr(func, 'func_defaults', None) or func.__defaults__
func_code = func.__code__
args = func_code.co_varnames[:func_code.co_argcount]
return args[-len(defaults):]
return args[-len(func.__defaults__):]


for ext, func in writers._VALID_SERIALIZERS.items():
Expand Down
5 changes: 0 additions & 5 deletions segno/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
DOES NOT belong to the public API.
"""
from __future__ import absolute_import, unicode_literals
from itertools import chain, repeat
try: # pragma: no cover
range = xrange
except NameError: # pragma: no cover
pass
from . import consts

__all__ = ('get_default_border_size', 'get_border', 'get_symbol_size',
Expand Down

0 comments on commit bdb6c42

Please sign in to comment.