|
6 | 6 | import types |
7 | 7 | import warnings |
8 | 8 |
|
| 9 | +import six |
9 | 10 | import py |
10 | 11 | # DON't import pytest here because it causes import cycle troubles |
11 | 12 | import sys |
@@ -149,7 +150,7 @@ def _prepareconfig(args=None, plugins=None): |
149 | 150 | try: |
150 | 151 | if plugins: |
151 | 152 | for plugin in plugins: |
152 | | - if isinstance(plugin, py.builtin._basestring): |
| 153 | + if isinstance(plugin, six.string_types): |
153 | 154 | pluginmanager.consider_pluginarg(plugin) |
154 | 155 | else: |
155 | 156 | pluginmanager.register(plugin) |
@@ -421,7 +422,7 @@ def import_plugin(self, modname): |
421 | 422 | # "terminal" or "capture". Those plugins are registered under their |
422 | 423 | # basename for historic purposes but must be imported with the |
423 | 424 | # _pytest prefix. |
424 | | - assert isinstance(modname, (py.builtin.text, str)), "module name as text required, got %r" % modname |
| 425 | + assert isinstance(modname, (six.text_type, str)), "module name as text required, got %r" % modname |
425 | 426 | modname = str(modname) |
426 | 427 | if self.get_plugin(modname) is not None: |
427 | 428 | return |
@@ -634,7 +635,7 @@ def __init__(self, *names, **attrs): |
634 | 635 | pass |
635 | 636 | else: |
636 | 637 | # this might raise a keyerror as well, don't want to catch that |
637 | | - if isinstance(typ, py.builtin._basestring): |
| 638 | + if isinstance(typ, six.string_types): |
638 | 639 | if typ == 'choice': |
639 | 640 | warnings.warn( |
640 | 641 | 'type argument to addoption() is a string %r.' |
@@ -947,7 +948,7 @@ def notify_exception(self, excinfo, option=None): |
947 | 948 | ) |
948 | 949 | res = self.hook.pytest_internalerror(excrepr=excrepr, |
949 | 950 | excinfo=excinfo) |
950 | | - if not py.builtin.any(res): |
| 951 | + if not any(res): |
951 | 952 | for line in str(excrepr).split("\n"): |
952 | 953 | sys.stderr.write("INTERNALERROR> %s\n" % line) |
953 | 954 | sys.stderr.flush() |
|
0 commit comments