Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Remove obsolete __future__ imports (#8337)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowJonathan authored Sep 17, 2020
1 parent c3c9732 commit 837293c
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 40 deletions.
1 change: 1 addition & 0 deletions changelog.d/8337.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove `__future__` imports related to Python 2 compatibility.
2 changes: 0 additions & 2 deletions contrib/cmdclient/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# limitations under the License.

""" Starts a synapse client console. """
from __future__ import print_function

import argparse
import cmd
import getpass
Expand Down
2 changes: 0 additions & 2 deletions contrib/cmdclient/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function

import json
import urllib
from pprint import pformat
Expand Down
2 changes: 0 additions & 2 deletions contrib/graph/graph.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import argparse
import cgi
import datetime
Expand Down
2 changes: 0 additions & 2 deletions contrib/graph/graph3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import argparse
import cgi
import datetime
Expand Down
2 changes: 0 additions & 2 deletions contrib/jitsimeetbridge/jitsimeetbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
Requires:
npm install jquery jsdom
"""
from __future__ import print_function

import json
import subprocess
import time
Expand Down
8 changes: 1 addition & 7 deletions contrib/scripts/kick_users.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
from __future__ import print_function

import json
import sys
Expand All @@ -8,11 +7,6 @@

import requests

try:
raw_input
except NameError: # Python 3
raw_input = input


def _mkurl(template, kws):
for key in kws:
Expand Down Expand Up @@ -58,7 +52,7 @@ def main(hs, room_id, access_token, user_id_prefix, why):
print("The following user IDs will be kicked from %s" % room_name)
for uid in kick_list:
print(uid)
doit = raw_input("Continue? [Y]es\n")
doit = input("Continue? [Y]es\n")
if len(doit) > 0 and doit.lower() == "y":
print("Kicking members...")
# encode them all
Expand Down
2 changes: 0 additions & 2 deletions scripts-dev/definitions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#! /usr/bin/python

from __future__ import print_function

import argparse
import ast
import os
Expand Down
2 changes: 0 additions & 2 deletions scripts-dev/dump_macaroon.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python2

from __future__ import print_function

import sys

import pymacaroons
Expand Down
2 changes: 0 additions & 2 deletions scripts-dev/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function

import argparse
import base64
import json
Expand Down
2 changes: 0 additions & 2 deletions scripts-dev/hash_history.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import sqlite3
import sys

Expand Down
2 changes: 0 additions & 2 deletions scripts/move_remote_media_to_new_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
PYTHON_PATH=. ./scripts/move_remote_media_to_new_store.py <source repo> <dest repo>
"""

from __future__ import print_function

import argparse
import logging
import os
Expand Down
2 changes: 0 additions & 2 deletions scripts/register_new_matrix_user
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function

from synapse._scripts.register_new_matrix_user import main

if __name__ == "__main__":
Expand Down
2 changes: 0 additions & 2 deletions synapse/_scripts/register_new_matrix_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function

import argparse
import getpass
import hashlib
Expand Down
2 changes: 0 additions & 2 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function

import gc
import logging
import math
Expand Down
1 change: 0 additions & 1 deletion synapse/config/emailconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function

# This file can't be called email.py because if it is, we cannot:
import email.utils
Expand Down
2 changes: 0 additions & 2 deletions synapse/config/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import division

import sys

from ._base import Config
Expand Down
2 changes: 0 additions & 2 deletions synapse/storage/databases/main/events_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import division

import itertools
import logging
import threading
Expand Down
2 changes: 0 additions & 2 deletions synapse/util/patch_inline_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function

import functools
import sys
from typing import Any, Callable, List
Expand Down

0 comments on commit 837293c

Please sign in to comment.