diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/PySnooper-8.iml b/.idea/PySnooper-8.iml new file mode 100644 index 0000000..4f2c9af --- /dev/null +++ b/.idea/PySnooper-8.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..dce2ee5 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..bf6a407 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pysnooper/utils.py b/pysnooper/utils.py index ff9b9e8..ad351f7 100644 --- a/pysnooper/utils.py +++ b/pysnooper/utils.py @@ -4,9 +4,9 @@ import abc import re -import sys from .pycompat import ABC, string_types, collections_abc + def _check_methods(C, *methods): mro = C.__mro__ for method in methods: @@ -32,15 +32,13 @@ class WritableStream(ABC): return NotImplemented - file_reading_errors = ( IOError, OSError, - ValueError # IronPython weirdness. + ValueError # IronPython weirdness. ) - def shitcode(s): return ''.join( (c if (0 < ord(c) < 256) else '?') for c in s @@ -89,10 +87,7 @@ def truncate(string, max_length): def ensure_tuple(x): if isinstance(x, collections_abc.Iterable) and \ - not isinstance(x, string_types): + not isinstance(x, string_types): return tuple(x) else: return (x,) - - -