Skip to content

Commit

Permalink
Switched on deprecation warning for old API by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbean-bremen committed Oct 19, 2018
1 parent d55e367 commit 0b89238
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
13 changes: 9 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ The release versions are PyPi releases.

## Version 3.5 (as yet unreleased)

This version of pyfakefs does not support Python 3.3. Python 3.3 users shall
keep using pyfakefs 3.4.3, or upgrade to a newer Python version.
#### Changes
* This version of pyfakefs does not support Python 3.3. Python 3.3 users
must keep using pyfakefs 3.4.3, or upgrade to a newer Python version.
* The deprecation warnings for the old API are now switched on by default.
To switch them off for legacy code, use:
```python
from pyfakefs.deprecator import Deprecator
Deprecator.show_warnings = False
```

#### New Features
* a module imported as another name (`import os as _os`) is now correctly
Expand All @@ -21,8 +28,6 @@ keep using pyfakefs 3.4.3, or upgrade to a newer Python version.
([#423](../../issues/423))
* added support for null device ([#418](../../issues/418))

#### Infrastructure

#### Fixes
* file timestamps are now updated more according to the real behavior
([#435](../../issues/435))
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ pyfakefs is currently automatically tested:
on Linux, with Python 2.7, and 3.4 to 3.7, using [Travis](https://travis-ci.org/jmcgeheeiv/pyfakefs)
* [![Build Status](https://travis-ci.org/jmcgeheeiv/pyfakefs.svg)](https://travis-ci.org/jmcgeheeiv/pyfakefs)
on MacOS, with Python 2.7, 3.6 and 3.7, using [Travis](https://travis-ci.org/jmcgeheeiv/pyfakefs)
[![Build Status](https://travis-ci.org/jmcgeheeiv/pyfakefs.svg)](https://travis-ci.org/jmcgeheeiv/pyfakefs)
* [![Build status](https://ci.appveyor.com/api/projects/status/4o8j21ufuo056873/branch/master?svg=true)](https://ci.appveyor.com/project/jmcgeheeiv/pyfakefs/branch/master)
on Windows, with Python 2.7, and 3.4 to 3.7 using [Appveyor](https://ci.appveyor.com/project/jmcgeheeiv/pyfakefs)

Expand Down
8 changes: 4 additions & 4 deletions pyfakefs/deprecator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
class Deprecator(object):
"""Decorator class for adding deprecated functions.
Warnings are switched off by default.
To enable deprecation warnings, use:
Warnings are switched on by default.
To disable deprecation warnings, use:
>>> from pyfakefs.deprecator import Deprecator
>>>
>>> Deprecator.show_warnings = True
>>> Deprecator.show_warnings = False
"""

show_warnings = False
show_warnings = True

def __init__(self, use_instead=None, func_name=None):
self.use_instead = use_instead
Expand Down

0 comments on commit 0b89238

Please sign in to comment.