openSUSE / py2pack

Generate distribution packages from PyPI
Apache License 2.0
69 stars 40 forks source link

Update utils.py #191

Closed huakim closed 8 months ago

huakim commented 8 months ago

Fix for Traceback (most recent call last):

  File "/bin/py2pack", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/py2pack/__init__.py", line 506, in main
    args.func(args)
  File "/usr/lib/python3.11/site-packages/py2pack/__init__.py", line 375, in generate
    _augment_data_from_tarball(args, tarball_file, data)
  File "/usr/lib/python3.11/site-packages/py2pack/__init__.py", line 276, in _augment_data_from_tarball
    _canonicalize_setup_data(data)
  File "/usr/lib/python3.11/site-packages/py2pack/__init__.py", line 225, in _canonicalize_setup_data
    console_scripts = get_setuptools_scripts(data)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/py2pack/utils.py", line 136, in get_setuptools_scripts
    scripts = (list(eps.select(group="console_scripts").names) +
                    ^^^
UnboundLocalError: cannot access local variable 'eps' where it is not associated with a value