forked from galaxyproject/galaxy
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
TypeError: OSError object is not subscriptable
under Python 3
Fix the following exception: ``` test/integration/test_cli_runners.py:90: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ lib/galaxy_test/driver/integration_util.py:73: in setUpClass cls._test_driver.setup(config_object=cls) lib/galaxy_test/driver/driver_util.py:942: in setup self._register_and_run_servers(config_object) lib/galaxy_test/driver/driver_util.py:1008: in _register_and_run_servers config_object=config_object, lib/galaxy_test/driver/driver_util.py:827: in launch_server host=host, port=port _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ webapp = <paste.urlmap.URLMap object at 0x7f011b68c110>, port = '8845' host = '127.0.0.1' def serve_webapp(webapp, port=None, host=None): """Serve the webapp on a recommend port or a free one. Return the port the webapp is running on. """ server = None for port in attempt_ports(port): try: server = httpserver.serve(webapp, host=host, port=port, start_loop=False) break except socket.error as e: > if e[0] == 98: E TypeError: 'OSError' object is not subscriptable ``` Also use `e.errno` instead of `e.args[0]` to get the errno of `socket.error`, since the latter may return an error string depending on how the exception was raised. Also: - move standard library imports to the top - fix issues reported by flake8-bugbear
- Loading branch information
Showing
2 changed files
with
17 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters