fix typos and stylistic nit
This commit is contained in:
parent
a7a97871fc
commit
de11e43d52
|
@ -497,7 +497,7 @@ class FullConstructor(SafeConstructor):
|
||||||
except ImportError, exc:
|
except ImportError, exc:
|
||||||
raise ConstructorError("while constructing a Python module", mark,
|
raise ConstructorError("while constructing a Python module", mark,
|
||||||
"cannot find module %r (%s)" % (name.encode('utf-8'), exc), mark)
|
"cannot find module %r (%s)" % (name.encode('utf-8'), exc), mark)
|
||||||
if not name in sys.modules:
|
if name not in sys.modules:
|
||||||
raise ConstructorError("while constructing a Python module", mark,
|
raise ConstructorError("while constructing a Python module", mark,
|
||||||
"module %r is not imported" % name.encode('utf-8'), mark)
|
"module %r is not imported" % name.encode('utf-8'), mark)
|
||||||
return sys.modules[name]
|
return sys.modules[name]
|
||||||
|
@ -517,7 +517,7 @@ class FullConstructor(SafeConstructor):
|
||||||
except ImportError, exc:
|
except ImportError, exc:
|
||||||
raise ConstructorError("while constructing a Python object", mark,
|
raise ConstructorError("while constructing a Python object", mark,
|
||||||
"cannot find module %r (%s)" % (module_name.encode('utf-8'), exc), mark)
|
"cannot find module %r (%s)" % (module_name.encode('utf-8'), exc), mark)
|
||||||
if not module_name in sys.modules:
|
if module_name not in sys.modules:
|
||||||
raise ConstructorError("while constructing a Python object", mark,
|
raise ConstructorError("while constructing a Python object", mark,
|
||||||
"module %r is not imported" % module_name.encode('utf-8'), mark)
|
"module %r is not imported" % module_name.encode('utf-8'), mark)
|
||||||
module = sys.modules[module_name]
|
module = sys.modules[module_name]
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver):
|
||||||
# UnsafeLoader is the same as Loader (which is and was always unsafe on
|
# UnsafeLoader is the same as Loader (which is and was always unsafe on
|
||||||
# untrusted input). Use of either Loader or UnsafeLoader should be rare, since
|
# untrusted input). Use of either Loader or UnsafeLoader should be rare, since
|
||||||
# FullLoad should be able to load almost all YAML safely. Loader is left intact
|
# FullLoad should be able to load almost all YAML safely. Loader is left intact
|
||||||
# to ensure backwards compatability.
|
# to ensure backwards compatibility.
|
||||||
class UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver):
|
class UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver):
|
||||||
|
|
||||||
def __init__(self, stream):
|
def __init__(self, stream):
|
||||||
|
|
|
@ -513,7 +513,7 @@ class FullConstructor(SafeConstructor):
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
raise ConstructorError("while constructing a Python module", mark,
|
raise ConstructorError("while constructing a Python module", mark,
|
||||||
"cannot find module %r (%s)" % (name, exc), mark)
|
"cannot find module %r (%s)" % (name, exc), mark)
|
||||||
if not name in sys.modules:
|
if name not in sys.modules:
|
||||||
raise ConstructorError("while constructing a Python module", mark,
|
raise ConstructorError("while constructing a Python module", mark,
|
||||||
"module %r is not imported" % name, mark)
|
"module %r is not imported" % name, mark)
|
||||||
return sys.modules[name]
|
return sys.modules[name]
|
||||||
|
@ -533,7 +533,7 @@ class FullConstructor(SafeConstructor):
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
raise ConstructorError("while constructing a Python object", mark,
|
raise ConstructorError("while constructing a Python object", mark,
|
||||||
"cannot find module %r (%s)" % (module_name, exc), mark)
|
"cannot find module %r (%s)" % (module_name, exc), mark)
|
||||||
if not module_name in sys.modules:
|
if module_name not in sys.modules:
|
||||||
raise ConstructorError("while constructing a Python object", mark,
|
raise ConstructorError("while constructing a Python object", mark,
|
||||||
"module %r is not imported" % module_name, mark)
|
"module %r is not imported" % module_name, mark)
|
||||||
module = sys.modules[module_name]
|
module = sys.modules[module_name]
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver):
|
||||||
# UnsafeLoader is the same as Loader (which is and was always unsafe on
|
# UnsafeLoader is the same as Loader (which is and was always unsafe on
|
||||||
# untrusted input). Use of either Loader or UnsafeLoader should be rare, since
|
# untrusted input). Use of either Loader or UnsafeLoader should be rare, since
|
||||||
# FullLoad should be able to load almost all YAML safely. Loader is left intact
|
# FullLoad should be able to load almost all YAML safely. Loader is left intact
|
||||||
# to ensure backwards compatability.
|
# to ensure backwards compatibility.
|
||||||
class UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver):
|
class UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver):
|
||||||
|
|
||||||
def __init__(self, stream):
|
def __init__(self, stream):
|
||||||
|
|
Loading…
Reference in New Issue