Mercurial > hg
comparison hgdemandimport/demandimportpy2.py @ 43787:be8552f25cab
cleanup: fix docstring formatting
This is just removing the b'' prefix (except demandimportpy2), and making sure
it is triple quoted. I skipped the mapping.py module in zope because that's 3rd
party code.
Differential Revision: https://phab.mercurial-scm.org/D7539
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 01 Dec 2019 18:46:10 -0500 |
parents | 9f70512ae2cf |
children | d4ba4d51f85f |
comparison
equal
deleted
inserted
replaced
43786:421ea5772039 | 43787:be8552f25cab |
---|---|
301 def isenabled(): | 301 def isenabled(): |
302 return builtins.__import__ == _demandimport | 302 return builtins.__import__ == _demandimport |
303 | 303 |
304 | 304 |
305 def enable(): | 305 def enable(): |
306 "enable global demand-loading of modules" | 306 """enable global demand-loading of modules""" |
307 builtins.__import__ = _demandimport | 307 builtins.__import__ = _demandimport |
308 | 308 |
309 | 309 |
310 def disable(): | 310 def disable(): |
311 "disable global demand-loading of modules" | 311 """disable global demand-loading of modules""" |
312 builtins.__import__ = _origimport | 312 builtins.__import__ = _origimport |
313 | 313 |
314 | 314 |
315 @contextmanager | 315 @contextmanager |
316 def deactivated(): | 316 def deactivated(): |
317 "context manager for disabling demandimport in 'with' blocks" | 317 """context manager for disabling demandimport in 'with' blocks""" |
318 demandenabled = isenabled() | 318 demandenabled = isenabled() |
319 if demandenabled: | 319 if demandenabled: |
320 disable() | 320 disable() |
321 | 321 |
322 try: | 322 try: |