-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
29 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import importlib | ||
import os | ||
|
||
|
||
__version__ = '1.0.1.dev0' | ||
|
||
|
||
class ShellDetectionFailure(EnvironmentError): | ||
pass | ||
|
||
|
||
def detect_shell(pid=None, max_depth=6): | ||
name = os.name | ||
try: | ||
impl = importlib.import_module('.' + name, __name__) | ||
except ImportError: | ||
raise RuntimeError( | ||
'Shell detection not implemented for {0!r}'.format(name), | ||
) | ||
try: | ||
get_shell = impl.get_shell | ||
except AttributeError: | ||
raise RuntimeError('get_shell not implemented for {0!r}'.format(name)) | ||
shell = get_shell(pid, max_depth=max_depth) | ||
if shell: | ||
return shell | ||
raise ShellDetectionFailure() | ||
import importlib | ||
import os | ||
|
||
|
||
__version__ = '1.1.0' | ||
|
||
|
||
class ShellDetectionFailure(EnvironmentError): | ||
pass | ||
|
||
|
||
def detect_shell(pid=None, max_depth=6): | ||
name = os.name | ||
try: | ||
impl = importlib.import_module('.' + name, __name__) | ||
except ImportError: | ||
raise RuntimeError( | ||
'Shell detection not implemented for {0!r}'.format(name), | ||
) | ||
try: | ||
get_shell = impl.get_shell | ||
except AttributeError: | ||
raise RuntimeError('get_shell not implemented for {0!r}'.format(name)) | ||
shell = get_shell(pid, max_depth=max_depth) | ||
if shell: | ||
return shell | ||
raise ShellDetectionFailure() |