| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 599cfea commit a108ee1
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,6 +20,12 @@ | |||
| 20 | 20 | from bpython.test import (FixLanguageTestCase as TestCase, MagicIterMock, mock, | |
| 21 | 21 | builtin_target, unittest) | |
| 22 | 22 | ||
| 23 | + if py3: | ||
| 24 | + from importlib import invalidate_caches | ||
| 25 | + else: | ||
| 26 | + def invalidate_caches(): | ||
| 27 | + """Does not exist before Python 3.3""" | ||
| 28 | + | ||
| 23 | 29 | ||
| 24 | 30 | def setup_config(conf): | |
| 25 | 31 | config_struct = config.Struct() | |
@@ -291,6 +297,7 @@ def setUp(self): | |||
| 291 | 297 | self.open = partial(io.open, mode='wt', encoding='utf-8') | |
| 292 | 298 | self.dont_write_bytecode = sys.dont_write_bytecode | |
| 293 | 299 | sys.dont_write_bytecode = True | |
| 300 | + invalidate_caches() | ||
| 294 | 301 | ||
| 295 | 302 | def tearDown(self): | |
| 296 | 303 | sys.dont_write_bytecode = self.dont_write_bytecode | |
| Back | FazBrowse Home | New Git URL |
0 commit comments